From 0db0528e8ef3aeeb68c73d51aa2bafa91459b83c Mon Sep 17 00:00:00 2001 From: Emmanuel ROHEE Date: Thu, 18 Sep 2014 15:19:35 +0200 Subject: Reverted patches done for SYWEB-40 --- webclient/components/matrix/event-handler-service.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'webclient/components') 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=0; i--) { - // FIXME: Being live != being state this.handleEvent(events[i], isLiveEvents, isLiveEvents); } // Store where to start pagination -- cgit 1.5.1 From b7d42c1e93034da2aa7185f1742c56c7bb45cbcc Mon Sep 17 00:00:00 2001 From: Emmanuel ROHEE Date: Thu, 18 Sep 2014 15:28:52 +0200 Subject: SYWEB-40: Only local rooms are shown in the recents list. Removed an old patch that deduplicated join events. This patch is now useless. Plus it is buggy since it compared event.content and event.prev_content only on the membership field whereas these objects contain more data now like displayname... --- webclient/components/matrix/event-handler-service.js | 7 ------- 1 file changed, 7 deletions(-) (limited to 'webclient/components') diff --git a/webclient/components/matrix/event-handler-service.js b/webclient/components/matrix/event-handler-service.js index d3de10c7e2..321054f904 100644 --- a/webclient/components/matrix/event-handler-service.js +++ b/webclient/components/matrix/event-handler-service.js @@ -232,13 +232,6 @@ function(matrixService, $rootScope, $q, $timeout, mPresence) { }; var handleRoomMember = function(event, isLiveEvent, isStateEvent) { - // if the server is stupidly re-relaying a no-op join, discard it. - if (event.prev_content && - event.content.membership === "join" && - event.content.membership === event.prev_content.membership) - { - return; - } // 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 -- cgit 1.5.1