Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F112155
D32.1732272271.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D32.1732272271.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 22, 2:44 AM (11 h, 30 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38816
Default Alt Text
D32.1732272271.diff (1 KB)
Attached To
Mode
D32: Display invited room at the top of RoomListView
Attached
Detach File
Event Timeline
Log In to Comment