From e9abbe89f3fd465089b2840d954d93fba933a44a Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Fri, 17 Oct 2014 23:53:24 +0100 Subject: [PATCH] more timestamp fixes --- webclient/components/matrix/event-handler-service.js | 4 ++-- webclient/recents/recents-filter.js | 4 ++-- webclient/recents/recents.html | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/webclient/components/matrix/event-handler-service.js b/webclient/components/matrix/event-handler-service.js index e990d42d0..492ec08bc 100644 --- a/webclient/components/matrix/event-handler-service.js +++ b/webclient/components/matrix/event-handler-service.js @@ -148,10 +148,10 @@ function(matrixService, $rootScope, $q, $timeout, mPresence) { // ts is later. var latestData = true; if (!isLiveEvent) { - var eventTs = event.ts; + var eventTs = event.origin_server_ts; var storedEvent = $rootScope.events.rooms[event.room_id][event.type]; if (storedEvent) { - if (storedEvent.ts > eventTs) { + if (storedEvent.origin_server_ts > eventTs) { // ignore it, we have a newer one already. latestData = false; } diff --git a/webclient/recents/recents-filter.js b/webclient/recents/recents-filter.js index 468a746b1..ef8d9897f 100644 --- a/webclient/recents/recents-filter.js +++ b/webclient/recents/recents-filter.js @@ -59,9 +59,9 @@ angular.module('RecentsController') return 1; } else { - return lastMsgRoomB.ts - lastMsgRoomA.ts; + return lastMsgRoomB.origin_server_ts - lastMsgRoomA.origin_server_ts; } }); return filtered; }; -}]); \ No newline at end of file +}]); diff --git a/webclient/recents/recents.html b/webclient/recents/recents.html index 9cbdcd357..fe6a2f636 100644 --- a/webclient/recents/recents.html +++ b/webclient/recents/recents.html @@ -18,7 +18,7 @@ Declaring it in this way ensures the data-binding --> {{ lastMsg = eventHandlerService.getLastMessage(room.room_id, true);"" }} - {{ (lastMsg.ts) | date:'MMM d HH:mm' }} + {{ (lastMsg.origin_server_ts) | date:'MMM d HH:mm' }} close