aboutsummaryrefslogtreecommitdiffstats
path: root/alias-angular/app/js
diff options
context:
space:
mode:
authorZaran <zaran.krleza@gmail.com>2012-04-18 00:20:16 -0700
committerZaran <zaran.krleza@gmail.com>2012-04-18 00:20:16 -0700
commit4dd22b71fc8198d7c8e72d6e0c41cb12298b8133 (patch)
treea8e47be3ddf6823e3ef3bb5f191b65f2172bdbad /alias-angular/app/js
parentfe62183cd914a7834c6d6a94d487e2e13e212251 (diff)
downloadalias-4dd22b71fc8198d7c8e72d6e0c41cb12298b8133.tar.gz
Fix the presence bug
the callback needs to return true so that it can be reused this must be done at the right place.
Diffstat (limited to 'alias-angular/app/js')
-rw-r--r--alias-angular/app/js/controllers.js5
-rw-r--r--alias-angular/app/js/services.js1
2 files changed, 2 insertions, 4 deletions
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) {