diff options
Diffstat (limited to 'webclient')
-rw-r--r-- | webclient/recents/recents-controller.js | 13 | ||||
-rw-r--r-- | webclient/recents/recents.html | 3 |
2 files changed, 16 insertions, 0 deletions
diff --git a/webclient/recents/recents-controller.js b/webclient/recents/recents-controller.js index 45a671e631..fcb203b36c 100644 --- a/webclient/recents/recents-controller.js +++ b/webclient/recents/recents-controller.js @@ -76,12 +76,25 @@ angular.module('RecentsController', ['matrixService', 'matrixFilter', 'eventHand if (room.messages && room.messages.chunk && room.messages.chunk[0]) { $rootScope.rooms[room.room_id].lastMsg = room.messages.chunk[0]; } + + + var numUsersInRoom = 0; + if (room.state) { + for (var j=0; j<room.state.length; j++) { + var stateEvent = room.state[j]; + if (stateEvent.type == "m.room.member" && stateEvent.content.membership == "join") { + numUsersInRoom += 1; + } + } + } + $rootScope.rooms[room.room_id].numUsersInRoom = numUsersInRoom; } var presence = initialSyncData.data.presence; for (var i = 0; i < presence.length; ++i) { eventHandlerService.handleEvent(presence[i], false); } + // From now, update recents from the stream listenToEventStream(); diff --git a/webclient/recents/recents.html b/webclient/recents/recents.html index 280d0632ab..b903412815 100644 --- a/webclient/recents/recents.html +++ b/webclient/recents/recents.html @@ -9,6 +9,9 @@ {{ room.room_id | mRoomName }} </td> <td class="recentsRoomSummaryTS"> + {{ room.numUsersInRoom }} users + </td> + <td class="recentsRoomSummaryTS"> {{ (room.lastMsg.ts) | date:'MMM d HH:mm' }} </td> </tr> |