summary refs log tree commit diff
path: root/syweb/webclient/recents
diff options
context:
space:
mode:
authorKegan Dougal <kegan@matrix.org>2014-11-17 10:04:36 +0000
committerKegan Dougal <kegan@matrix.org>2014-11-17 10:04:36 +0000
commit547adda446c3ddf66c6666f681a279582d5f5320 (patch)
tree2f4092bcde608e94eaf14177573716d9f7385139 /syweb/webclient/recents
parents/eventHandlerService.getUsersCountInRoom/modelService.getUserCountInRoom/g (diff)
downloadsynapse-547adda446c3ddf66c6666f681a279582d5f5320.tar.xz
Move getLastMessage to modelService.
Diffstat (limited to '')
-rw-r--r--syweb/webclient/recents/recents-controller.js6
-rw-r--r--syweb/webclient/recents/recents-filter.js8
-rw-r--r--syweb/webclient/recents/recents.html2
3 files changed, 8 insertions, 8 deletions
diff --git a/syweb/webclient/recents/recents-controller.js b/syweb/webclient/recents/recents-controller.js
index 41720d4cb0..6b2915d03b 100644
--- a/syweb/webclient/recents/recents-controller.js
+++ b/syweb/webclient/recents/recents-controller.js
@@ -17,11 +17,11 @@
 'use strict';
 
 angular.module('RecentsController', ['matrixService', 'matrixFilter'])
-.controller('RecentsController', ['$rootScope', '$scope', 'eventHandlerService', 'modelService', 'recentsService',
-                               function($rootScope, $scope, eventHandlerService, modelService, recentsService) {
+.controller('RecentsController', ['$rootScope', '$scope', 'modelService', 'recentsService',
+                               function($rootScope, $scope, modelService, recentsService) {
 
     // Expose the service to the view
-    $scope.eventHandlerService = eventHandlerService;
+    $scope.modelService = modelService;
     
     // retrieve all rooms and expose them
     $scope.rooms = modelService.getRooms();
diff --git a/syweb/webclient/recents/recents-filter.js b/syweb/webclient/recents/recents-filter.js
index 00304f84dc..31859b1c7f 100644
--- a/syweb/webclient/recents/recents-filter.js
+++ b/syweb/webclient/recents/recents-filter.js
@@ -17,7 +17,7 @@
 'use strict';
 
 angular.module('RecentsController')
-.filter('orderRecents', ["matrixService", "eventHandlerService", "modelService", function(matrixService, eventHandlerService, modelService) {
+.filter('orderRecents', ["matrixService", "modelService", function(matrixService, modelService) {
     return function(rooms) {
         var user_id = matrixService.config().user_id;
 
@@ -39,7 +39,7 @@ angular.module('RecentsController')
                     room.recent.inviter = member.user_id;
                 }
                 // Count users here
-                // TODO: Compute it directly in eventHandlerService
+                // TODO: Compute it directly in modelService
                 room.recent.numUsersInRoom = modelService.getUserCountInRoom(room_id);
 
                 filtered.push(room);
@@ -54,8 +54,8 @@ angular.module('RecentsController')
         // The room with the latest message at first
         filtered.sort(function (roomA, roomB) {
 
-            var lastMsgRoomA = eventHandlerService.getLastMessage(roomA.room_id, true);
-            var lastMsgRoomB = eventHandlerService.getLastMessage(roomB.room_id, true);
+            var lastMsgRoomA = modelService.getLastMessage(roomA.room_id, true);
+            var lastMsgRoomB = modelService.getLastMessage(roomB.room_id, true);
 
             // Invite message does not have a body message nor ts
             // Puth them at the top of the list
diff --git a/syweb/webclient/recents/recents.html b/syweb/webclient/recents/recents.html
index 600e1f9c1a..2596b094f7 100644
--- a/syweb/webclient/recents/recents.html
+++ b/syweb/webclient/recents/recents.html
@@ -16,7 +16,7 @@
                 <td class="recentsRoomSummaryTS">
                     <!-- Use a temp var as alias to the last room message.
                          Declaring it in this way ensures the data-binding -->
-                    {{ lastMsg = eventHandlerService.getLastMessage(room.room_id, true);"" }}
+                    {{ lastMsg = modelService.getLastMessage(room.room_id, true);"" }}
 
                     {{ (lastMsg.origin_server_ts) | date:'MMM d HH:mm' }}