Skip to content
Snippets Groups Projects
Commit 2eaa199e authored by Kegan Dougal's avatar Kegan Dougal
Browse files

Added number of users in recent rooms.

parent 83ce5730
No related branches found
No related tags found
No related merge requests found
......@@ -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();
......
......@@ -8,6 +8,9 @@
<td class="recentsRoomName">
{{ room.room_id | mRoomName }}
</td>
<td class="recentsRoomSummaryTS">
{{ room.numUsersInRoom }} users
</td>
<td class="recentsRoomSummaryTS">
{{ (room.lastMsg.ts) | date:'MMM d HH:mm' }}
</td>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment