Introduce a new RoomProxyType and treat rooms differently based on their membership state

This commit is contained in:
Stefan Ceriu
2024-08-20 16:13:27 +03:00
committed by Stefan Ceriu
parent e0ba9925e7
commit e281a3f242
97 changed files with 3755 additions and 3474 deletions
@@ -57,7 +57,7 @@ final class NotificationSettingsEditScreenCoordinator: CoordinatorProtocol {
// MARK: - Private
private func presentRoomNotificationSettings(roomID: String) async {
guard let roomProxy = await parameters.userSession.clientProxy.roomForIdentifier(roomID) else { return }
guard case let .joined(roomProxy) = await parameters.userSession.clientProxy.roomForIdentifier(roomID) else { return }
let roomNotificationSettingsParameters = RoomNotificationSettingsScreenCoordinatorParameters(navigationStackCoordinator: parameters.navigationStackCoordinator,
notificationSettingsProxy: parameters.notificationSettings,
@@ -138,7 +138,7 @@ class NotificationSettingsEditScreenViewModel: NotificationSettingsEditScreenVie
var roomsWithUserDefinedMode: [NotificationSettingsEditScreenRoom] = []
for roomSummary in filteredRoomsSummary {
guard let roomProxy = await userSession.clientProxy.roomForIdentifier(roomSummary.id) else { continue }
guard case let .joined(roomProxy) = await userSession.clientProxy.roomForIdentifier(roomSummary.id) else { continue }
// `isOneToOneRoom` here is not the same as `isDirect` on the room. From the point of view of the push rule, a one-to-one room is a room with exactly two active members.
let isOneToOneRoom = roomProxy.activeMembersCount == 2
// display only the rooms we're interested in