From 9b1ca64a75160b44106d5a7b4ddc96a009f56012 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Mon, 3 Nov 2014 13:26:50 +0000 Subject: Fix bug which prevented the number of users being visible on the recents view. --- webclient/components/matrix/event-handler-service.js | 3 +-- webclient/recents/recents-filter.js | 4 ++-- webclient/recents/recents.html | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/webclient/components/matrix/event-handler-service.js b/webclient/components/matrix/event-handler-service.js index 00e3edf184..953ce839ea 100644 --- a/webclient/components/matrix/event-handler-service.js +++ b/webclient/components/matrix/event-handler-service.js @@ -540,13 +540,12 @@ function(matrixService, $rootScope, $q, $timeout, mPresence, notificationService var room = modelService.getRoom(room_id); memberCount = 0; - for (var i in room.current_room_state.members) { if (!room.current_room_state.members.hasOwnProperty(i)) continue; var member = room.current_room_state.members[i]; - if ("join" === member.membership) { + if ("join" === member.content.membership) { memberCount = memberCount + 1; } } diff --git a/webclient/recents/recents-filter.js b/webclient/recents/recents-filter.js index acd9f86ece..db7fc5e4ee 100644 --- a/webclient/recents/recents-filter.js +++ b/webclient/recents/recents-filter.js @@ -31,8 +31,8 @@ angular.module('RecentsController') // (ie, do not show it if he has been banned) var member = modelService.getMember(room_id, user_id); room.recent.me = member; - if (member && ("invite" === member.membership || "join" === member.membership)) { - if ("invite" === member.membership) { + if (member && ("invite" === member.content.membership || "join" === member.content.membership)) { + if ("invite" === member.content.membership) { room.recent.inviter = member.user_id; } // Count users here diff --git a/webclient/recents/recents.html b/webclient/recents/recents.html index 2a633ebe24..a11e6be532 100644 --- a/webclient/recents/recents.html +++ b/webclient/recents/recents.html @@ -9,7 +9,7 @@ {{ room.room_id | mRoomName }} - + {{ room.recent.numUsersInRoom || '1' }} {{ room.recent.numUsersInRoom == 1 ? 'user' : 'users' }} -- cgit 1.4.1