Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F112615
D32.1732338841.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.1732338841.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
Fri, Nov 22, 9:14 PM (18 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38814
Default Alt Text
D32.1732338841.diff (1 KB)
Attached To
Mode
D32: Display invited room at the top of RoomListView
Attached
Detach File
Event Timeline
Log In to Comment