Skip to content

Commit 059416a

Browse files
committed
Correctly filter who is being added as a contact. Update scope when contact is added or removed.
1 parent c601448 commit 059416a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

static/js/directives/chat.js

+5
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,12 @@ define(['jquery', 'underscore', 'text!partials/chat.html', 'text!partials/chatro
345345
contacts.remove(buddy.contact.Userid);
346346
};
347347
subscope.updateContactStatus = function(event, data) {
348+
var userid = buddy && buddy.session && buddy.session.Userid;
349+
if (userid !== data.Userid) {
350+
return;
351+
}
348352
subscope.isContact = event.type === "contactadded";
353+
safeApply(subscope);
349354
};
350355
contacts.e.on("contactadded", subscope.updateContactStatus);
351356
contacts.e.on("contactremoved", subscope.updateContactStatus);

0 commit comments

Comments
 (0)