Room summary: fix "No timestamp on last bubble" (vector-im/riot-ios#1129 - 2)

By simplifying the way how the last message cell is computed
This commit is contained in:
manuroe
2017-04-03 08:44:31 +02:00
parent 5a13e5646c
commit 44789c5657
+5 -10
View File
@@ -97,22 +97,17 @@
if (count)
{
// Look for the cell data which contains the last message.
// Reset first the flag in each cell data
// Enable the containsLastMessage flag for the cell data which contains the last message.
@synchronized(bubbles)
{
// Reset first all cell data
for (RoomBubbleCellData *cellData in bubbles)
{
cellData.containsLastMessage = NO;
}
}
// Set the flag in the right cell data
NSString *lastMessageEventID = self.room.summary.lastMessageEventId;
if (lastMessageEventID)
{
RoomBubbleCellData *cellData = [self cellDataOfEventWithEventId:lastMessageEventID];
// The cell containing the last message is the last one
RoomBubbleCellData *cellData = bubbles.lastObject;
cellData.containsLastMessage = YES;
}
}