Handle NAME_EVENT to get room name update event

(TODO: recents needs to be directly plugged to $rootScope.events.rooms)
This commit is contained in:
Emmanuel ROHEE 2014-09-12 10:51:05 +02:00
parent d934328904
commit 311dc61803
1 changed files with 5 additions and 0 deletions

View File

@ -68,6 +68,11 @@ angular.module('RecentsController', ['matrixService', 'matrixFilter', 'eventHand
$rootScope.rooms[event.room_id] = event;
}
});
$rootScope.$on(eventHandlerService.NAME_EVENT, function(ngEvent, event, isLive) {
if (isLive) {
$rootScope.rooms[event.room_id].lastMsg = event;
}
});
$rootScope.$on(eventHandlerService.TOPIC_EVENT, function(ngEvent, event, isLive) {
if (isLive) {
$rootScope.rooms[event.room_id].lastMsg = event;