Page MenuHomePhorge

D32.1732338841.diff
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

D32.1732338841.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
@@ -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

Mime Type
text/plain
Expires
Fri, Nov 22, 9:14 PM (4 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38814
Default Alt Text
D32.1732338841.diff (1 KB)

Event Timeline