diff options
author | Matthew Hodgson <matthew@matrix.org> | 2014-08-21 19:02:00 +0100 |
---|---|---|
committer | Matthew Hodgson <matthew@matrix.org> | 2014-08-21 19:02:00 +0100 |
commit | 3277a650529d4ecaf816987e6cbcb87fdf3371da (patch) | |
tree | 8b42774eb4386ef79c7dc708320c68b5baf5fa79 /webclient/components | |
parent | Add a var. (diff) | |
download | synapse-3277a650529d4ecaf816987e6cbcb87fdf3371da.tar.xz |
actually display room metadata based on m.room.membe events
Diffstat (limited to 'webclient/components')
-rw-r--r-- | webclient/components/matrix/event-handler-service.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/webclient/components/matrix/event-handler-service.js b/webclient/components/matrix/event-handler-service.js index b8529895fe..6a01b3fb55 100644 --- a/webclient/components/matrix/event-handler-service.js +++ b/webclient/components/matrix/event-handler-service.js @@ -69,6 +69,17 @@ angular.module('eventHandlerService', []) var handleRoomMember = function(event, isLiveEvent) { initRoom(event.room_id); + + // add membership changes as if they were a room message if something interesting changed + if (event.content.prev !== event.content.membership) { + if (isLiveEvent) { + $rootScope.events.rooms[event.room_id].messages.push(event); + } + else { + $rootScope.events.rooms[event.room_id].messages.unshift(event); + } + } + $rootScope.events.rooms[event.room_id].members[event.user_id] = event; $rootScope.$broadcast(MEMBER_EVENT, event, isLiveEvent); }; |