Page MenuHomePhorge

D32.1732272271.diff
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

D32.1732272271.diff

diff --git a/src/matrix-room-list.cpp b/src/matrix-room-list.cpp
--- a/src/matrix-room-list.cpp
+++ b/src/matrix-room-list.cpp
@@ -100,8 +100,22 @@
container.begin(),
container.end(),
[allRooms](const std::string &idA, const std::string &idB) {
- return latestEventTimestamp(allRooms[idA])
- > latestEventTimestamp(allRooms[idB]);
+ const auto &roomA = allRooms[idA];
+ const auto &roomB = allRooms[idB];
+ auto aIsInvite = roomA.membership == Invite;
+ auto bIsInvite = roomB.membership == Invite;
+ if (aIsInvite != bIsInvite) {
+ /**
+ * if my membership in A is invite,
+ * then the membership in B is not invite,
+ * so A should come first;
+ * otherwise B should come first
+ **/
+ return aIsInvite;
+ } else {
+ return latestEventTimestamp(roomA)
+ > latestEventTimestamp(roomB);
+ }
}
);
return immer::flex_vector<std::string>(container.begin(), container.end());

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 22, 2:44 AM (17 h, 13 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38816
Default Alt Text
D32.1732272271.diff (1 KB)

Event Timeline