summary refs log tree commit diff
path: root/syweb/webclient/recents
diff options
context:
space:
mode:
authorKegan Dougal <kegan@matrix.org>2014-11-12 15:31:06 +0000
committerKegan Dougal <kegan@matrix.org>2014-11-12 15:31:06 +0000
commit960b28c90a6ca8b9c61a3b376b4f9223203f4f06 (patch)
tree43b2c56407d38515e6bcaee5f679ea928520c46d /syweb/webclient/recents
parentMigrate unread messages logic to recentsService. (diff)
downloadsynapse-960b28c90a6ca8b9c61a3b376b4f9223203f4f06.tar.xz
SYWEB-57: Highlight rooms which have had their bingers go off in blue.
Priority is the same as xchat so selected > blue > red.
Diffstat (limited to 'syweb/webclient/recents')
-rw-r--r--syweb/webclient/recents/recents-controller.js6
-rw-r--r--syweb/webclient/recents/recents.html2
2 files changed, 7 insertions, 1 deletions
diff --git a/syweb/webclient/recents/recents-controller.js b/syweb/webclient/recents/recents-controller.js
index 5c2cf270c3..41720d4cb0 100644
--- a/syweb/webclient/recents/recents-controller.js
+++ b/syweb/webclient/recents/recents-controller.js
@@ -38,6 +38,12 @@ angular.module('RecentsController', ['matrixService', 'matrixFilter'])
         $scope.unreadMessages = recentsService.getUnreadMessages();
     });
     
+    // track the list of unread BING messages: the html will use this
+    $scope.unreadBings = recentsService.getUnreadBingMessages();
+    $scope.$on(recentsService.BROADCAST_UNREAD_BING_MESSAGES, function(ngEvent, room_id, event) {
+        $scope.unreadBings = recentsService.getUnreadBingMessages();
+    });
+    
     $scope.selectRoom = function(room) {
         recentsService.markAsRead(room.room_id);
         $rootScope.goToPage('room/' + (room.room_alias ? room.room_alias : room.room_id) );
diff --git a/syweb/webclient/recents/recents.html b/syweb/webclient/recents/recents.html
index 386edb1417..0b3a77ca11 100644
--- a/syweb/webclient/recents/recents.html
+++ b/syweb/webclient/recents/recents.html
@@ -3,7 +3,7 @@
         <tbody ng-repeat="(index, room) in rooms | orderRecents" 
                ng-click="selectRoom(room)" 
                class="recentsRoom"
-               ng-class="{'recentsRoomSelected': (room.room_id === recentsSelectedRoomID), 'recentsRoomUnread': (unreadMessages[room.room_id])}">
+               ng-class="{'recentsRoomSelected': (room.room_id === recentsSelectedRoomID), 'recentsRoomBing': (unreadBings[room.room_id]), 'recentsRoomUnread': (unreadMessages[room.room_id])}">
             <tr>
                 <td ng-class="room.current_room_state.state('m.room.join_rules').content.join_rule == 'public' ? 'recentsRoomName recentsPublicRoom' : 'recentsRoomName'">
                     {{ room.room_id | mRoomName }}