mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-20 00:24:43 +02:00
Use new comparator
This commit is contained in:
@@ -74,17 +74,8 @@
|
||||
|
||||
// Sort rooms according to their last messages (most recent first)
|
||||
NSComparator comparator = ^NSComparisonResult(MXKRecentCellData *recentCellData1, MXKRecentCellData *recentCellData2) {
|
||||
|
||||
NSComparisonResult result = NSOrderedAscending;
|
||||
if (recentCellData2.roomSummary.lastMessageOriginServerTs > recentCellData1.roomSummary.lastMessageOriginServerTs)
|
||||
{
|
||||
result = NSOrderedDescending;
|
||||
}
|
||||
else if (recentCellData2.roomSummary.lastMessageOriginServerTs == recentCellData1.roomSummary.lastMessageOriginServerTs)
|
||||
{
|
||||
result = NSOrderedSame;
|
||||
}
|
||||
return result;
|
||||
|
||||
return [recentCellData1.roomSummary.lastMessage compareOriginServerTs:recentCellData2.roomSummary.lastMessage];
|
||||
};
|
||||
[cellData sortUsingComparator:comparator];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user