diff options
author | Erik Johnston <erik@matrix.org> | 2014-09-03 14:40:54 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2014-09-03 14:41:38 +0100 |
commit | 073a42cc9528ae1df07e81ce8fcd301b457230c5 (patch) | |
tree | c09f622974ba83fff2e083c71c70a5fd0ead5469 /webclient/components | |
parent | Make retrying requests on DNS failures configurable, and turn off retrying on... (diff) | |
download | synapse-073a42cc9528ae1df07e81ce8fcd301b457230c5.tar.xz |
Add support for room names
Diffstat (limited to 'webclient/components')
-rw-r--r-- | webclient/components/matrix/event-handler-service.js | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/webclient/components/matrix/event-handler-service.js b/webclient/components/matrix/event-handler-service.js index 7c62cd1b5d..bf6103d50d 100644 --- a/webclient/components/matrix/event-handler-service.js +++ b/webclient/components/matrix/event-handler-service.js @@ -34,6 +34,7 @@ angular.module('eventHandlerService', []) var PRESENCE_EVENT = "PRESENCE_EVENT"; var POWERLEVEL_EVENT = "POWERLEVEL_EVENT"; var CALL_EVENT = "CALL_EVENT"; + var NAME_EVENT = "NAME_EVENT"; var InitialSyncDeferred = $q.defer(); @@ -115,6 +116,15 @@ angular.module('eventHandlerService', []) } }; + var handleRoomName = function(event, isLiveEvent) { + console.log("handleRoomName " + isLiveEvent); + + initRoom(event.room_id); + + $rootScope.events.rooms[event.room_id][event.type] = event; + $rootScope.$broadcast(NAME_EVENT, event, isLiveEvent); + }; + var handleCallEvent = function(event, isLiveEvent) { $rootScope.$broadcast(CALL_EVENT, event, isLiveEvent); }; @@ -126,6 +136,7 @@ angular.module('eventHandlerService', []) PRESENCE_EVENT: PRESENCE_EVENT, POWERLEVEL_EVENT: POWERLEVEL_EVENT, CALL_EVENT: CALL_EVENT, + NAME_EVENT: NAME_EVENT, handleEvent: function(event, isLiveEvent) { @@ -149,7 +160,9 @@ angular.module('eventHandlerService', []) case 'm.room.power_levels': handlePowerLevels(event, isLiveEvent); break; - + case 'm.room.name': + handleRoomName(event, isLiveEvent); + break; default: console.log("Unable to handle event type " + event.type); console.log(JSON.stringify(event, undefined, 4)); |