Get presence for members when you enter a room (it was coming down but wasn't being stored in the right place)

paul/schema_breaking_changes
Kegan Dougal 2014-08-15 17:47:45 +01:00
parent 5b817ecd44
commit 0e6a2f87f9
1 changed files with 4 additions and 0 deletions

View File

@ -111,6 +111,10 @@ angular.module('RoomController', [])
var updateMemberList = function(chunk) { var updateMemberList = function(chunk) {
var isNewMember = !(chunk.target_user_id in $scope.members); var isNewMember = !(chunk.target_user_id in $scope.members);
if (isNewMember) { if (isNewMember) {
if ("state" in chunk.content) {
chunk.presenceState = chunk.content.state;
}
$scope.members[chunk.target_user_id] = chunk; $scope.members[chunk.target_user_id] = chunk;
// get their display name and profile picture and set it to their // get their display name and profile picture and set it to their
// member entry in $scope.members. We HAVE to use $timeout with 0 delay // member entry in $scope.members. We HAVE to use $timeout with 0 delay