<commit_before>// The angular module and defintions for state associated with the underlying
// app. This code defines
'use strict';

// TODO: client secret should not be public.
/**
var OAUTH_CONFIG = {
  'client_id': '814927071113-ri9amn1jl73c7rbh2dvif2g78fok8vs9.apps.googleusercontent.com',
  'client_secret': '<KEY>
  'api_scope': 'https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/googletalk'
};
**/

var bg = chrome.extension.getBackgroundPage();

angular.module('UProxyChromeExtension', ['angular-lodash'])
  //.constant('googleAuth', new OAuth2('google', OAUTH_CONFIG))
  //.constant('GOOG_PROFILE_URL', 'https://www.googleapis.com/oauth2/v1/userinfo')
  // can remove once https://github.com/angular/angular.js/issues/2963 is fixed:
  .config(function ($provide) {
    $provide.decorator('$sniffer', ['$delegate', function ($sniffer) {
      $sniffer.csp = true;
      return $sniffer;
    }]);
  }) //
  .filter('chromei18n', function () {
    var getMessage = chrome.i18n.getMessage;
    return function (key) {
      return getMessage(key);
    };
  })
  .filter('messageable', function () {
    return function (contact) {
      return _.any(contact.clients, {status: 'messageable'});
    };
  })
  .filter('onlineNotMessageable', ['$filter', function ($filter) {
    var messageable = $filter('messageable');
    return function (contact) {
      return _.any(contact.clients, {status: 'online'}) && !messageable(contact);
    };
  }])
  .filter('offline', function () {
    return function (contact) {
      return _.all(contact.clients, {status: 'offline'});
    };
  })
  .constant('bg', chrome.extension.getBackgroundPage())
  .constant('chrome', chrome)
  .constant('freedom', chrome.extension.getBackgroundPage().freedom)
  // application state. determined by backend (packaged app)
  .constant('model', {})
  // Run gets called every time the popup is openned. This initialises the main
  // extension UI and makes sure it is in sync with the app.
  .run([
    '$filter',
    '$http',
    '$rootScope',
    'GOOG_PROFILE_URL',
    'bg',
    'chrome',
    'freedom',
    'googleAuth',
    'model',
    function($filter, $http, $rootScope, GOOG_PROFILE_URL, bg, chrome, freedom, googleAuth, model) {
      var filter = $filter('filter'),
          messageable = $filter('messageable'),
          onlineNotMessageable = $filter('onlineNotMessageable');

      $rootScope.extensionID = chrome.runtime.id;
      $rootScope.model = model;

      $rootScope.$watch('model.roster', function (roster) {
        if (!roster) return;
        $rootScope.contactsOnlineNotMessageable = filter(roster, onlineNotMessageable);
        $rootScope.contactsMessageable = filter(roster, messageable);
      }, true);

      $rootScope.$watch('model.canGetFrom', updateCanGetFrom, true);
      $rootScope.$watch('contactsMessageable', updateCanGetFrom, true);

      function updateCanGetFrom() {
        $rootScope.canGetFrom = {};
        $rootScope.cannotGetFrom = {};
        _.each($rootScope.contactsMessageable, function (contact) {
          if (contact.userId in model.canGetFrom) {<commit_msg>comment out remaining oauth references<commit_after>// The angular module and defintions for state associated with the underlying
// app. This code defines
'use strict';

// TODO: client secret should not be public.
/**
var OAUTH_CONFIG = {
  'client_id': '814927071113-ri9amn1jl73c7rbh2dvif2g78fok8vs9.apps.googleusercontent.com',
  'client_secret': '<KEY>
  'api_scope': 'https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/googletalk'
};
**/

var bg = chrome.extension.getBackgroundPage();

angular.module('UProxyChromeExtension', ['angular-lodash'])
  //.constant('googleAuth', new OAuth2('google', OAUTH_CONFIG))
  //.constant('GOOG_PROFILE_URL', 'https://www.googleapis.com/oauth2/v1/userinfo')
  // can remove once https://github.com/angular/angular.js/issues/2963 is fixed:
  .config(function ($provide) {
    $provide.decorator('$sniffer', ['$delegate', function ($sniffer) {
      $sniffer.csp = true;
      return $sniffer;
    }]);
  }) //
  .filter('chromei18n', function () {
    var getMessage = chrome.i18n.getMessage;
    return function (key) {
      return getMessage(key);
    };
  })
  .filter('messageable', function () {
    return function (contact) {
      return _.any(contact.clients, {status: 'messageable'});
    };
  })
  .filter('onlineNotMessageable', ['$filter', function ($filter) {
    var messageable = $filter('messageable');
    return function (contact) {
      return _.any(contact.clients, {status: 'online'}) && !messageable(contact);
    };
  }])
  .filter('offline', function () {
    return function (contact) {
      return _.all(contact.clients, {status: 'offline'});
    };
  })
  .constant('bg', chrome.extension.getBackgroundPage())
  .constant('chrome', chrome)
  .constant('freedom', chrome.extension.getBackgroundPage().freedom)
  // application state. determined by backend (packaged app)
  .constant('model', {})
  // Run gets called every time the popup is openned. This initialises the main
  // extension UI and makes sure it is in sync with the app.
  .run([
    '$filter',
    '$http',
    '$rootScope',
    //'GOOG_PROFILE_URL',
    'bg',
    'chrome',
    'freedom',
    //'googleAuth',
    'model',
    function($filter, $http, $rootScope, /*GOOG_PROFILE_URL,*/ bg, chrome, freedom, /*googleAuth,*/ model) {
      var filter = $filter('filter'),
          messageable = $filter('messageable'),
          onlineNotMessageable = $filter('onlineNotMessageable');

      $rootScope.extensionID = chrome.runtime.id;
      $rootScope.model = model;

      $rootScope.$watch('model.roster', function (roster) {
        if (!roster) return;
        $rootScope.contactsOnlineNotMessageable = filter(roster, onlineNotMessageable);
        $rootScope.contactsMessageable = filter(roster, messageable);
      }, true);

      $rootScope.$watch('model.canGetFrom', updateCanGetFrom, true);
      $rootScope.$watch('contactsMessageable', updateCanGetFrom, true);

      function updateCanGetFrom() {
        $rootScope.canGetFrom = {};
        $rootScope.cannotGetFrom = {};
        _.each($rootScope.contactsMessageable, function (contact) {
          if (contact.userId in model.canGetFrom) {
{'fraction_non_alphanumeric': 0.15484689830239567, 'fraction_numerical': 0.010788513406314454, 'mean_word_length': 3.6455416359616803, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 8, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5545508', 'n_tokens_mistral': 2002, 'n_tokens_neox': 1947, 'n_words': 410}