summary refs log tree commit diff
path: root/webclient
diff options
context:
space:
mode:
authorEmmanuel ROHEE <erohee@amdocs.com>2014-09-18 15:19:35 +0200
committerEmmanuel ROHEE <erohee@amdocs.com>2014-09-18 15:19:35 +0200
commit0db0528e8ef3aeeb68c73d51aa2bafa91459b83c (patch)
tree6a69d4fb028af7faca432e4f1765b41a38111edc /webclient
parentMerge branch 'release-v0.3.0' of github.com:matrix-org/synapse (diff)
downloadsynapse-0db0528e8ef3aeeb68c73d51aa2bafa91459b83c.tar.xz
Reverted patches done for SYWEB-40
Diffstat (limited to 'webclient')
-rw-r--r--webclient/components/matrix/event-handler-service.js10
-rw-r--r--webclient/recents/recents-filter.js8
2 files changed, 6 insertions, 12 deletions
diff --git a/webclient/components/matrix/event-handler-service.js b/webclient/components/matrix/event-handler-service.js
index ad69d297fa..d3de10c7e2 100644
--- a/webclient/components/matrix/event-handler-service.js
+++ b/webclient/components/matrix/event-handler-service.js
@@ -243,9 +243,8 @@ 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 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
+        // with other other room messages
+        if (event.content.prev !== event.content.membership && !isStateEvent) {
             if (isLiveEvent) {
                 $rootScope.events.rooms[event.room_id].messages.push(event);
             }
@@ -376,7 +375,6 @@ function(matrixService, $rootScope, $q, $timeout, mPresence) {
                         handleMessage(event, isLiveEvent);
                         break;
                     case "m.room.member":
-                        isStateEvent = true;
                         handleRoomMember(event, isLiveEvent, isStateEvent);
                         break;
                     case "m.presence":
@@ -406,8 +404,6 @@ 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<events.length; i++) {
                 this.handleEvent(events[i], isLiveEvents, isStateEvents);
             }
@@ -423,7 +419,6 @@ function(matrixService, $rootScope, $q, $timeout, mPresence) {
             if (dir && 'b' === dir) {
                 // paginateBackMessages requests messages to be in reverse chronological order
                 for (var i=0; i<events.length; i++) {
-                    // FIXME: Being live != being state
                     this.handleEvent(events[i], isLiveEvents, isLiveEvents);
                 }
                 
@@ -433,7 +428,6 @@ function(matrixService, $rootScope, $q, $timeout, mPresence) {
             else {
                 // InitialSync returns messages in chronological order
                 for (var i=events.length - 1; i>=0; i--) {
-                    // FIXME: Being live != being state
                     this.handleEvent(events[i], isLiveEvents, isLiveEvents);
                 }
                 // Store where to start pagination
diff --git a/webclient/recents/recents-filter.js b/webclient/recents/recents-filter.js
index d948205e19..e8323f4a31 100644
--- a/webclient/recents/recents-filter.js
+++ b/webclient/recents/recents-filter.js
@@ -19,14 +19,13 @@
 angular.module('RecentsController')
 .filter('orderRecents', ["matrixService", "eventHandlerService", function(matrixService, eventHandlerService) {
     return function(rooms) {
-
         var user_id = matrixService.config().user_id;
 
         // Transform the dict into an array
         // The key, room_id, is already in value objects
         var filtered = [];
         angular.forEach(rooms, function(room, room_id) {
-
+            
             // Show the room only if the user has joined it or has been invited
             // (ie, do not show it if he has been banned)
             var member = eventHandlerService.getMember(room_id, user_id);
@@ -35,8 +34,9 @@ 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
@@ -60,4 +60,4 @@ angular.module('RecentsController')
         });
         return filtered;
     };
-}]);
+}]);
\ No newline at end of file