mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-28 23:32:41 +00:00
Use new comparator
This commit is contained in:
parent
c51e51d564
commit
5ccf4a4737
1 changed files with 2 additions and 11 deletions
|
@ -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];
|
||||
|
||||
|
|
Loading…
Reference in a new issue