Read markers should be synchronised across clients

Improve "jump to last unread message" banner handling

https://github.com/vector-im/riot-meta/issues/8
This commit is contained in:
Giom Foret
2017-06-13 17:46:13 +02:00
parent 7101af2bc1
commit 42536710e4
+4 -4
View File
@@ -3564,12 +3564,12 @@
}
else
{
// Check whether the read marker event is anterior to the last event displayed in the first rendered cell.
MXKRoomBubbleComponent *component = roomBubbleTableViewCell.bubbleData.bubbleComponents.lastObject;
MXEvent *lastDisplayedEvent = component.event;
// Check whether the read marker event is anterior to the first event displayed in the first rendered cell.
MXKRoomBubbleComponent *component = roomBubbleTableViewCell.bubbleData.bubbleComponents.firstObject;
MXEvent *firstDisplayedEvent = component.event;
MXEvent *currentReadMarkerEvent = [self.roomDataSource.mxSession.store eventWithEventId:self.roomDataSource.room.accountData.readMarkerEventId inRoom:self.roomDataSource.roomId];
if (!currentReadMarkerEvent || (currentReadMarkerEvent.originServerTs < lastDisplayedEvent.originServerTs))
if (!currentReadMarkerEvent || (currentReadMarkerEvent.originServerTs < firstDisplayedEvent.originServerTs))
{
self.jumpToLastUnreadBannerContainer.hidden = NO;
}