From 2438b8b66b8dc08d0fe77447b0a3cdb39e9a8f95 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Mon, 3 Nov 2014 17:52:41 +0000 Subject: Fix off-by-one bug when displaying display names / avatar urls when paginating. --- webclient/components/matrix/event-handler-service.js | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'webclient') diff --git a/webclient/components/matrix/event-handler-service.js b/webclient/components/matrix/event-handler-service.js index eff8674e04..1b9a99eaa4 100644 --- a/webclient/components/matrix/event-handler-service.js +++ b/webclient/components/matrix/event-handler-service.js @@ -201,6 +201,13 @@ function(matrixService, $rootScope, $q, $timeout, mPresence, notificationService } else if (!isLiveEvent) { // mutate the old room state + var oldEvent = angular.copy(event); + if (event.prev_content) { + // the m.room.member event we are handling is the NEW event. When + // we keep going back in time, we want the PREVIOUS value for displaying + // names/etc, hence the clobber here. + event.content = event.prev_content; + } room.old_room_state.storeStateEvent(angular.copy(event)); } -- cgit 1.4.1