Browse Source

Make sure to set scope for userid if none is there yet.

pull/48/head
Simon Eisenmann 12 years ago
parent
commit
342a833eed
  1. 13
      static/js/services/buddylist.js

13
static/js/services/buddylist.js

@ -219,7 +219,18 @@ define(['underscore', 'modernizr', 'avltree', 'text!partials/buddy.html', 'text! @@ -219,7 +219,18 @@ define(['underscore', 'modernizr', 'avltree', 'text!partials/buddy.html', 'text!
Buddylist.prototype.onBuddySessionUserid = function(scope, sourceSession) {
var targetScope = buddyData.get(sourceSession.Userid);
var userid = sourceSession.Userid;
/*
if (userid === scope.userid) {
// The source session has our own userid, ignore it.
}*/
var targetScope = buddyData.get(userid);
if (!targetScope) {
// No scope for this userid yet - set us.
buddyData.set(userid, scope);
return;
}
if (targetScope === scope) {
// No action.
return;

Loading…
Cancel
Save