<commit_before>'use strict';

angular.module('copayApp.controllers').controller('botController',
  function($stateParams, $scope, $rootScope, $timeout, configService, profileService, isCordova, go, correspondentListService) {
	
	var self = this;
	var bots = require('byteballcore/bots.js');
	var fc = profileService.focusedClient;
	$scope.backgroundColor = fc.backgroundColor;
	$scope.$root = $rootScope;
	
	var id = $stateParams.id;

	bots.getBotByID(id, function(bot){
		bot.description = correspondentListService.escapeHtmlAndInsertBr(bot.description);
		$scope.bot = bot;
		$timeout(function(){
			$scope.$digest();
		});
	})

	$scope.pair = function(bot) {
		var matches = bot.pairing_code.match(/^([\w\/+]+)@([\w.:\/-]+)#([\w\/+-]+)$/);
		var pubkey = matches[1];
		var hub = matches[2];
		var pairing_secret = matches[3];
		$scope.index.setOngoingProcess("pairing", true);
		correspondentListService.acceptInvitation(hub, pubkey, pairing_secret, function(err){
			$scope.index.setOngoingProcess("pairing", false);
		});
	}

	$scope.open = function(bot) {
		correspondentListService.setCurrentCorrespondent(bot.device_address, function(){
			go.path('correspondentDevices.correspondentDevice');
		});
	}
}).directive('dynamic', function ($compile) {
	return {
		restrict: 'A',
		replace: true,
		link: function (scope, ele, attrs) {
			scope.$watch(attrs.dynamic, function(html) {
				ele.html(html);
				$compile(ele.contents())(scope);
			});
		}
	};
});<commit_msg>removed directive copy<commit_after>'use strict';

angular.module('copayApp.controllers').controller('botController',
  function($stateParams, $scope, $rootScope, $timeout, configService, profileService, isCordova, go, correspondentListService) {
	
	var self = this;
	var bots = require('byteballcore/bots.js');
	var fc = profileService.focusedClient;
	$scope.backgroundColor = fc.backgroundColor;
	$scope.$root = $rootScope;
	
	var id = $stateParams.id;

	bots.getBotByID(id, function(bot){
		bot.description = correspondentListService.escapeHtmlAndInsertBr(bot.description);
		$scope.bot = bot;
		$timeout(function(){
			$scope.$digest();
		});
	})

	$scope.pair = function(bot) {
		var matches = bot.pairing_code.match(/^([\w\/+]+)@([\w.:\/-]+)#([\w\/+-]+)$/);
		var pubkey = matches[1];
		var hub = matches[2];
		var pairing_secret = matches[3];
		$scope.index.setOngoingProcess("pairing", true);
		correspondentListService.acceptInvitation(hub, pubkey, pairing_secret, function(err){
			$scope.index.setOngoingProcess("pairing", false);
		});
	}

	$scope.open = function(bot) {
		correspondentListService.setCurrentCorrespondent(bot.device_address, function(){
			go.path('correspondentDevices.correspondentDevice');
		});
	}
});
{'fraction_non_alphanumeric': 0.1739290989660266, 'fraction_numerical': 0.0022156573116691287, 'mean_word_length': 5.329439252336448, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '4502887', 'n_tokens_mistral': 995, 'n_tokens_neox': 913, 'n_words': 145}