From a2d64e93a359f4b0b06d7a2411ea46e4ce5c939f Mon Sep 17 00:00:00 2001 From: Doug Date: Thu, 11 Nov 2021 15:43:43 +0000 Subject: [PATCH 1/2] Refresh RecentsListService when switching modes. --- .../Recents/Service/MatrixSDK/RecentsListService.swift | 7 ++++++- changelog.d/5105.bugfix | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 changelog.d/5105.bugfix diff --git a/Riot/Modules/Common/Recents/Service/MatrixSDK/RecentsListService.swift b/Riot/Modules/Common/Recents/Service/MatrixSDK/RecentsListService.swift index 3261caa22..6651fddba 100644 --- a/Riot/Modules/Common/Recents/Service/MatrixSDK/RecentsListService.swift +++ b/Riot/Modules/Common/Recents/Service/MatrixSDK/RecentsListService.swift @@ -20,7 +20,12 @@ import Foundation public class RecentsListService: NSObject, RecentsListServiceProtocol { private weak var session: MXSession? - public private(set) var mode: RecentsDataSourceMode + public private(set) var mode: RecentsDataSourceMode { + didSet { + refresh() + } + } + public private(set) var query: String? public private(set) var space: MXSpace? diff --git a/changelog.d/5105.bugfix b/changelog.d/5105.bugfix new file mode 100644 index 000000000..4b833133a --- /dev/null +++ b/changelog.d/5105.bugfix @@ -0,0 +1 @@ +Fix room ordering when switching between Home and People/Rooms/Favourites. \ No newline at end of file From 21df1862e1a5389a14ed6f54a0fc608110c6e1b2 Mon Sep 17 00:00:00 2001 From: ismailgulek Date: Thu, 11 Nov 2021 19:52:21 +0300 Subject: [PATCH 2/2] Implement new summary properties --- .../Recents/Service/Mock/MockRoomSummary.swift | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Riot/Modules/Common/Recents/Service/Mock/MockRoomSummary.swift b/Riot/Modules/Common/Recents/Service/Mock/MockRoomSummary.swift index 713932423..c211db025 100644 --- a/Riot/Modules/Common/Recents/Service/Mock/MockRoomSummary.swift +++ b/Riot/Modules/Common/Recents/Service/Mock/MockRoomSummary.swift @@ -60,6 +60,18 @@ public class MockRoomSummary: NSObject, MXRoomSummaryProtocol { public var highlightCount: UInt = 0 + public var hasAnyUnread: Bool { + return localUnreadEventCount > 0 + } + + public var hasAnyNotification: Bool { + return notificationCount > 0 + } + + public var hasAnyHighlight: Bool { + return highlightCount > 0 + } + public var isDirect: Bool { return isTyped(.direct) }