summary refs log tree commit diff
path: root/webclient/components
diff options
context:
space:
mode:
authorKegan Dougal <kegan@matrix.org>2014-09-08 15:36:52 -0700
committerKegan Dougal <kegan@matrix.org>2014-09-08 15:36:52 -0700
commit324020d5fe212badfbd38137adc8dcecfdc15980 (patch)
tree050b5568fab3f0126e65dbebacc530b3ce5481e0 /webclient/components
parentUpdate jsfiddles to have more helpful error messages when there is no connect... (diff)
downloadsynapse-324020d5fe212badfbd38137adc8dcecfdc15980.tar.xz
Display the room topic in the room, underneath the name of the room.
Diffstat (limited to 'webclient/components')
-rw-r--r--webclient/components/matrix/event-handler-service.js11
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 173055a61b..a14e515999 100644
--- a/webclient/components/matrix/event-handler-service.js
+++ b/webclient/components/matrix/event-handler-service.js
@@ -148,6 +148,14 @@ angular.module('eventHandlerService', [])
         $rootScope.events.rooms[event.room_id][event.type] = event;
         $rootScope.$broadcast(NAME_EVENT, event, isLiveEvent);
     };
+    
+    var handleRoomTopic = function(event, isLiveEvent) {
+        console.log("handleRoomTopic " + isLiveEvent);
+
+        initRoom(event.room_id);
+
+        $rootScope.events.rooms[event.room_id][event.type] = event;
+    };
 
     var handleCallEvent = function(event, isLiveEvent) {
         $rootScope.$broadcast(CALL_EVENT, event, isLiveEvent);
@@ -204,6 +212,9 @@ angular.module('eventHandlerService', [])
                     case 'm.room.name':
                         handleRoomName(event, isLiveEvent);
                         break;
+                    case 'm.room.topic':
+                        handleRoomTopic(event, isLiveEvent);
+                        break;
                     default:
                         console.log("Unable to handle event type " + event.type);
                         console.log(JSON.stringify(event, undefined, 4));