Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F85969737
D32.1796237696.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D32.1796237696.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
@@ -107,17 +107,35 @@
return immer::flex_vector<std::string>(container.begin(), container.end());
};
+ std::vector<std::string> allRoomIds;
if (tagIdStdStr.empty()) {
- return sortByTimestampDesc(zug::into_vector(
- toId | applyFilter,
- allRooms
- ));
+ allRoomIds = zug::into_vector(toId, allRooms);
} else {
- return sortByTimestampDesc(zug::into_vector(
- toId | applyFilter,
- roomsByTagMap[tagIdStdStr]
- ));
+ allRoomIds = zug::into_vector(toId, roomsByTagMap[tagIdStdStr]);
}
+ /**
+ * Iterator to the first element of the room id list
+ * excluding rooms that need to be pinned to the top.
+ **/
+ auto otherRoomIdIter = std::partition(
+ allRoomIds.begin(),
+ allRoomIds.end(),
+ [&allRooms](const auto &id) {
+ return allRooms[id].membership == Invite;
+ });
+ auto inviteRoomIds = std::vector(
+ allRoomIds.begin(),
+ otherRoomIdIter);
+ auto otherRoomIds = std::vector(
+ otherRoomIdIter,
+ allRoomIds.end());
+
+ return sortByTimestampDesc(zug::into_vector(
+ applyFilter,
+ inviteRoomIds)) +
+ sortByTimestampDesc(zug::into_vector(
+ applyFilter,
+ otherRoomIds));
}))
, LAGER_QT(filter)(m_filter.xform(strToQt, qStringToStd))
, LAGER_QT(count)(m_roomIds.xform(containerSize))
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Dec 2, 10:54 AM (23 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1854753
Default Alt Text
D32.1796237696.diff (1 KB)
Attached To
Mode
D32: Display invited room at the top of RoomListView
Attached
Detach File
Event Timeline