Page MenuHomePhorge

D32.1726795659.diff
No OneTemporary

D32.1726795659.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
Thu, Sep 19, 6:27 PM (9 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15893
Default Alt Text
D32.1726795659.diff (1 KB)

Event Timeline