From 32808e4111d4f2db9ad0af7e0eacb96d7f0d81fc Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Thu, 18 Sep 2014 10:05:34 +0100 Subject: [PATCH 1/3] Still add the room to the filtered list even if you can't work out the number of users in the room. --- webclient/recents/recents-filter.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/webclient/recents/recents-filter.js b/webclient/recents/recents-filter.js index 2fd4dbe98..d948205e1 100644 --- a/webclient/recents/recents-filter.js +++ b/webclient/recents/recents-filter.js @@ -35,9 +35,8 @@ angular.module('RecentsController') // Count users here // TODO: Compute it directly in eventHandlerService room.numUsersInRoom = eventHandlerService.getUsersCountInRoom(room_id); - - filtered.push(room); } + filtered.push(room); }); // And time sort them @@ -61,4 +60,4 @@ angular.module('RecentsController') }); return filtered; }; -}]); \ No newline at end of file +}]); From fbf221ae6d47f3b7d99666dc36fbe6e4d96fe24a Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Thu, 18 Sep 2014 10:35:44 +0100 Subject: [PATCH 2/3] Patch for SYWEB-40 : isStateEvent is not being set correctly, and really shouldn't be a configurable arg in the first place. As a result of being undefined, the events.rooms[rid].members object was not being updated in some cases, which combined with the recents-filter bug (32808e4), caused federated rooms to not appear in the recents list. --- webclient/components/matrix/event-handler-service.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/webclient/components/matrix/event-handler-service.js b/webclient/components/matrix/event-handler-service.js index d3de10c7e..ad69d297f 100644 --- a/webclient/components/matrix/event-handler-service.js +++ b/webclient/components/matrix/event-handler-service.js @@ -243,8 +243,9 @@ function(matrixService, $rootScope, $q, $timeout, mPresence) { // add membership changes as if they were a room message if something interesting changed // Exception: Do not do this if the event is a room state event because such events already come // as room messages events. Moreover, when they come as room messages events, they are relatively ordered - // with other other room messages - if (event.content.prev !== event.content.membership && !isStateEvent) { + // with other other room messages XXX This is no longer true, you only get a single event, not a room message event. + // FIXME: This possibly reintroduces multiple join messages. + if (event.content.prev !== event.content.membership) { // && !isStateEvent if (isLiveEvent) { $rootScope.events.rooms[event.room_id].messages.push(event); } @@ -375,6 +376,7 @@ function(matrixService, $rootScope, $q, $timeout, mPresence) { handleMessage(event, isLiveEvent); break; case "m.room.member": + isStateEvent = true; handleRoomMember(event, isLiveEvent, isStateEvent); break; case "m.presence": @@ -404,6 +406,8 @@ function(matrixService, $rootScope, $q, $timeout, mPresence) { // isLiveEvents determines whether notifications should be shown, whether // messages get appended to the start/end of lists, etc. handleEvents: function(events, isLiveEvents, isStateEvents) { + // XXX FIXME TODO: isStateEvents is being left as undefined sometimes. It makes no sense + // to have isStateEvents as an arg, since things like m.room.member are ALWAYS state events. for (var i=0; i=0; i--) { + // FIXME: Being live != being state this.handleEvent(events[i], isLiveEvents, isLiveEvents); } // Store where to start pagination From 9cebfd9d90b6b35b49b85d2405dccd9a4e6d7f92 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Thu, 18 Sep 2014 11:35:59 +0100 Subject: [PATCH 3/3] SYWEB-3 : Boldify if the join_rule is public, rather than visibility so it plays nicer with federation. --- webclient/recents/recents.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webclient/recents/recents.html b/webclient/recents/recents.html index 7fec8f03e..edfc1677e 100644 --- a/webclient/recents/recents.html +++ b/webclient/recents/recents.html @@ -5,7 +5,7 @@ class ="recentsRoom" ng-class="{'recentsRoomSelected': (room.room_id === recentsSelectedRoomID)}"> - + {{ room.room_id | mRoomName }}