From 4dd22b71fc8198d7c8e72d6e0c41cb12298b8133 Mon Sep 17 00:00:00 2001 From: Zaran Date: Wed, 18 Apr 2012 00:20:16 -0700 Subject: Fix the presence bug the callback needs to return true so that it can be reused this must be done at the right place. --- alias-angular/app/js/controllers.js | 5 +---- alias-angular/app/js/services.js | 1 + 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'alias-angular') diff --git a/alias-angular/app/js/controllers.js b/alias-angular/app/js/controllers.js index 162f794..4288a10 100644 --- a/alias-angular/app/js/controllers.js +++ b/alias-angular/app/js/controllers.js @@ -35,7 +35,6 @@ ConnectCtl.$inject = ['$scope', 'StropheSrv', '$log', '$rootScope']; function RosterCtl($scope, StropheSrv, $log) { $scope.contacts = {}; function onRoster(iq) { - $log.log('im here'); var elems = iq.getElementsByTagName('query'); var query = elems[0]; Strophe.forEachChild(query, 'item', function(item){ @@ -60,9 +59,7 @@ function RosterCtl($scope, StropheSrv, $log) { $scope.contacts[jid]['status'] = 'away'; } } - delete $scope.contacts[jid]; } - return true; } $scope.$on('connected', function() { StropheSrv.addHandler(onPresence, 'presence'); @@ -73,7 +70,7 @@ function RosterCtl($scope, StropheSrv, $log) { var query = $iq({type : 'get'}).c('query', {xmlns : Strophe.NS.ROSTER}); StropheSrv.sendIQ(query, onRoster); }; - } +} RosterCtl.$inject = ['$scope','StropheSrv','$log']; diff --git a/alias-angular/app/js/services.js b/alias-angular/app/js/services.js index 68e1537..9cfeb81 100644 --- a/alias-angular/app/js/services.js +++ b/alias-angular/app/js/services.js @@ -16,6 +16,7 @@ angular.module('Alias.services', [], function($provide) { addHandler: function(callback, name) { connection.addHandler(function(stanza){ $rootScope.$apply(callback(stanza)); + return true; }, null, name, null, null, null, null); }, send: function(stanza) { -- cgit v1.2.3-70-g09d2