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 cfbc6f4bd8..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,8 +39,8 @@ angular.module('RecentsController')
room.recent.inviter = member.user_id;
}
// Count users here
- // TODO: Compute it directly in eventHandlerService
- room.recent.numUsersInRoom = eventHandlerService.getUsersCountInRoom(room_id);
+ // 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 0b3a77ca11..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' }}
@@ -84,7 +84,7 @@
</div>
<div ng-switch-default>
- {{ lastMsg.content }}
+ {{ lastMsg.content.body | linky:'_blank' }}
</div>
</div>
</div>
|