Remove notification settings feature flag (#1693)

This commit is contained in:
Nicolas Mauri
2023-09-13 14:05:32 +02:00
committed by GitHub
parent f96969ac37
commit 8268ecc036
42 changed files with 88 additions and 145 deletions
@@ -37,7 +37,6 @@ final class AppSettings {
case userSuggestionsEnabled case userSuggestionsEnabled
case readReceiptsEnabled case readReceiptsEnabled
case hasShownWelcomeScreen case hasShownWelcomeScreen
case notificationSettingsEnabled
case swiftUITimelineEnabled case swiftUITimelineEnabled
case richTextEditorEnabled case richTextEditorEnabled
} }
@@ -236,9 +235,6 @@ final class AppSettings {
@UserPreference(key: UserDefaultsKeys.readReceiptsEnabled, defaultValue: false, storageType: .userDefaults(store)) @UserPreference(key: UserDefaultsKeys.readReceiptsEnabled, defaultValue: false, storageType: .userDefaults(store))
var readReceiptsEnabled var readReceiptsEnabled
@UserPreference(key: UserDefaultsKeys.notificationSettingsEnabled, defaultValue: false, storageType: .userDefaults(store))
var notificationSettingsEnabled
@UserPreference(key: UserDefaultsKeys.swiftUITimelineEnabled, defaultValue: false, storageType: .volatile) @UserPreference(key: UserDefaultsKeys.swiftUITimelineEnabled, defaultValue: false, storageType: .volatile)
var swiftUITimelineEnabled var swiftUITimelineEnabled
@@ -268,7 +268,7 @@ class HomeScreenViewModel: HomeScreenViewModelType, HomeScreenViewModelProtocol
private func buildRoom(with details: RoomSummaryDetails, invalidated: Bool) -> HomeScreenRoom { private func buildRoom(with details: RoomSummaryDetails, invalidated: Bool) -> HomeScreenRoom {
let identifier = invalidated ? "invalidated-" + details.id : details.id let identifier = invalidated ? "invalidated-" + details.id : details.id
let notificationMode = details.notificationMode == .allMessages || appSettings.notificationSettingsEnabled == false ? nil : details.notificationMode let notificationMode = details.notificationMode == .allMessages ? nil : details.notificationMode
return HomeScreenRoom(id: identifier, return HomeScreenRoom(id: identifier,
roomId: details.id, roomId: details.id,
@@ -54,8 +54,7 @@ final class RoomDetailsScreenCoordinator: CoordinatorProtocol {
roomProxy: parameters.roomProxy, roomProxy: parameters.roomProxy,
mediaProvider: parameters.mediaProvider, mediaProvider: parameters.mediaProvider,
userIndicatorController: parameters.userIndicatorController, userIndicatorController: parameters.userIndicatorController,
notificationSettingsProxy: parameters.notificationSettings, notificationSettingsProxy: parameters.notificationSettings)
appSettings: ServiceLocator.shared.settings)
} }
// MARK: - Public // MARK: - Public
@@ -48,7 +48,6 @@ struct RoomDetailsScreenViewState: BindableState {
var canEditRoomName = false var canEditRoomName = false
var canEditRoomTopic = false var canEditRoomTopic = false
var canEditRoomAvatar = false var canEditRoomAvatar = false
let showNotificationSettings: Bool
var notificationSettingsState: RoomDetailsNotificationSettingsState = .loading var notificationSettingsState: RoomDetailsNotificationSettingsState = .loading
var canEdit: Bool { var canEdit: Bool {
@@ -64,10 +63,7 @@ struct RoomDetailsScreenViewState: BindableState {
var dmRecipient: RoomMemberDetails? var dmRecipient: RoomMemberDetails?
var shortcuts: [RoomDetailsScreenViewShortcut] { var shortcuts: [RoomDetailsScreenViewShortcut] {
var shortcuts: [RoomDetailsScreenViewShortcut] = [] var shortcuts: [RoomDetailsScreenViewShortcut] = [.mute]
if showNotificationSettings {
shortcuts.append(.mute)
}
if let permalink = dmRecipient?.permalink { if let permalink = dmRecipient?.permalink {
shortcuts.append(.share(link: permalink)) shortcuts.append(.share(link: permalink))
} else if let permalink { } else if let permalink {
@@ -38,8 +38,7 @@ class RoomDetailsScreenViewModel: RoomDetailsScreenViewModelType, RoomDetailsScr
roomProxy: RoomProxyProtocol, roomProxy: RoomProxyProtocol,
mediaProvider: MediaProviderProtocol, mediaProvider: MediaProviderProtocol,
userIndicatorController: UserIndicatorControllerProtocol, userIndicatorController: UserIndicatorControllerProtocol,
notificationSettingsProxy: NotificationSettingsProxyProtocol, notificationSettingsProxy: NotificationSettingsProxyProtocol) {
appSettings: AppSettings) {
self.accountUserID = accountUserID self.accountUserID = accountUserID
self.roomProxy = roomProxy self.roomProxy = roomProxy
self.mediaProvider = mediaProvider self.mediaProvider = mediaProvider
@@ -55,7 +54,6 @@ class RoomDetailsScreenViewModel: RoomDetailsScreenViewModelType, RoomDetailsScr
topic: roomProxy.topic, topic: roomProxy.topic,
avatarURL: roomProxy.avatarURL, avatarURL: roomProxy.avatarURL,
joinedMembersCount: roomProxy.joinedMembersCount, joinedMembersCount: roomProxy.joinedMembersCount,
showNotificationSettings: appSettings.notificationSettingsEnabled,
notificationSettingsState: .loading, notificationSettingsState: .loading,
bindings: .init()), bindings: .init()),
imageProvider: mediaProvider) imageProvider: mediaProvider)
@@ -32,9 +32,7 @@ struct RoomDetailsScreen: View {
topicSection topicSection
if context.viewState.showNotificationSettings { notificationSection
notificationSection
}
if context.viewState.dmRecipient == nil { if context.viewState.dmRecipient == nil {
aboutSection aboutSection
@@ -277,14 +275,12 @@ struct RoomDetailsScreen_Previews: PreviewProvider {
notificationSettingsProxyMockConfiguration.roomMode.isDefault = false notificationSettingsProxyMockConfiguration.roomMode.isDefault = false
let notificationSettingsProxy = NotificationSettingsProxyMock(with: notificationSettingsProxyMockConfiguration) let notificationSettingsProxy = NotificationSettingsProxyMock(with: notificationSettingsProxyMockConfiguration)
let appSettings = AppSettings() let appSettings = AppSettings()
appSettings.notificationSettingsEnabled = true
return RoomDetailsScreenViewModel(accountUserID: "@owner:somewhere.com", return RoomDetailsScreenViewModel(accountUserID: "@owner:somewhere.com",
roomProxy: roomProxy, roomProxy: roomProxy,
mediaProvider: MockMediaProvider(), mediaProvider: MockMediaProvider(),
userIndicatorController: ServiceLocator.shared.userIndicatorController, userIndicatorController: ServiceLocator.shared.userIndicatorController,
notificationSettingsProxy: notificationSettingsProxy, notificationSettingsProxy: notificationSettingsProxy)
appSettings: appSettings)
}() }()
static let dmRoomViewModel = { static let dmRoomViewModel = {
@@ -307,8 +303,7 @@ struct RoomDetailsScreen_Previews: PreviewProvider {
roomProxy: roomProxy, roomProxy: roomProxy,
mediaProvider: MockMediaProvider(), mediaProvider: MockMediaProvider(),
userIndicatorController: ServiceLocator.shared.userIndicatorController, userIndicatorController: ServiceLocator.shared.userIndicatorController,
notificationSettingsProxy: notificationSettingsProxy, notificationSettingsProxy: notificationSettingsProxy)
appSettings: appSettings)
}() }()
static let simpleRoomViewModel = { static let simpleRoomViewModel = {
@@ -328,8 +323,7 @@ struct RoomDetailsScreen_Previews: PreviewProvider {
roomProxy: roomProxy, roomProxy: roomProxy,
mediaProvider: MockMediaProvider(), mediaProvider: MockMediaProvider(),
userIndicatorController: ServiceLocator.shared.userIndicatorController, userIndicatorController: ServiceLocator.shared.userIndicatorController,
notificationSettingsProxy: notificationSettingsProxy, notificationSettingsProxy: notificationSettingsProxy)
appSettings: appSettings)
}() }()
static var previews: some View { static var previews: some View {
@@ -48,7 +48,6 @@ protocol DeveloperOptionsProtocol: AnyObject {
var shouldCollapseRoomStateEvents: Bool { get set } var shouldCollapseRoomStateEvents: Bool { get set }
var userSuggestionsEnabled: Bool { get set } var userSuggestionsEnabled: Bool { get set }
var readReceiptsEnabled: Bool { get set } var readReceiptsEnabled: Bool { get set }
var notificationSettingsEnabled: Bool { get set }
var swiftUITimelineEnabled: Bool { get set } var swiftUITimelineEnabled: Bool { get set }
var richTextEditorEnabled: Bool { get set } var richTextEditorEnabled: Bool { get set }
} }
@@ -47,13 +47,6 @@ struct DeveloperOptionsScreen: View {
} }
} }
Section("Notifications") {
Toggle(isOn: $context.notificationSettingsEnabled) {
Text("Show notification settings")
Text("Requires app reboot")
}
}
Section("Room creation") { Section("Room creation") {
Toggle(isOn: $context.userSuggestionsEnabled) { Toggle(isOn: $context.userSuggestionsEnabled) {
Text("User suggestions") Text("User suggestions")
@@ -37,7 +37,6 @@ struct SettingsScreenViewState: BindableState {
var userAvatarURL: URL? var userAvatarURL: URL?
var userDisplayName: String? var userDisplayName: String?
var showSessionVerificationSection: Bool var showSessionVerificationSection: Bool
var showNotificationSettings: Bool
var showDeveloperOptions: Bool var showDeveloperOptions: Bool
/// The presentation anchor used to display the OIDC account URL. /// The presentation anchor used to display the OIDC account URL.
@@ -41,7 +41,6 @@ class SettingsScreenViewModel: SettingsScreenViewModelType, SettingsScreenViewMo
userID: userSession.userID, userID: userSession.userID,
accountURL: userSession.clientProxy.accountURL, accountURL: userSession.clientProxy.accountURL,
showSessionVerificationSection: showSessionVerificationSection, showSessionVerificationSection: showSessionVerificationSection,
showNotificationSettings: appSettings.notificationSettingsEnabled,
showDeveloperOptions: appSettings.canShowDeveloperOptions), showDeveloperOptions: appSettings.canShowDeveloperOptions),
imageProvider: userSession.mediaProvider) imageProvider: userSession.mediaProvider)
@@ -53,10 +52,6 @@ class SettingsScreenViewModel: SettingsScreenViewModelType, SettingsScreenViewMo
.weakAssign(to: \.state.userAvatarURL, on: self) .weakAssign(to: \.state.userAvatarURL, on: self)
.store(in: &cancellables) .store(in: &cancellables)
appSettings.$notificationSettingsEnabled
.weakAssign(to: \.state.showNotificationSettings, on: self)
.store(in: &cancellables)
Task { Task {
await userSession.clientProxy.loadUserAvatarURL() await userSession.clientProxy.loadUserAvatarURL()
} }
@@ -124,14 +124,12 @@ struct SettingsScreen: View {
} }
// Notifications // Notifications
if context.viewState.showNotificationSettings { ListRow(label: .default(title: L10n.screenNotificationSettingsTitle,
ListRow(label: .default(title: L10n.screenNotificationSettingsTitle, systemIcon: .bell),
systemIcon: .bell), kind: .navigationLink {
kind: .navigationLink { context.send(viewAction: .notifications)
context.send(viewAction: .notifications) })
}) .accessibilityIdentifier(A11yIdentifiers.settingsScreen.notifications)
.accessibilityIdentifier(A11yIdentifiers.settingsScreen.notifications)
}
// Analytics // Analytics
ListRow(label: .default(title: L10n.commonAnalytics, ListRow(label: .default(title: L10n.commonAnalytics,
@@ -225,7 +223,6 @@ struct SettingsScreen_Previews: PreviewProvider {
deviceID: "AAAAAAAAAAA", deviceID: "AAAAAAAAAAA",
accountURL: "https://matrix.org/account"), accountURL: "https://matrix.org/account"),
mediaProvider: MockMediaProvider()) mediaProvider: MockMediaProvider())
ServiceLocator.shared.settings.notificationSettingsEnabled = true
return SettingsScreenViewModel(userSession: userSession, return SettingsScreenViewModel(userSession: userSession,
appSettings: ServiceLocator.shared.settings) appSettings: ServiceLocator.shared.settings)
}() }()
@@ -405,7 +405,6 @@ class ClientProxy: ClientProxyProtocol {
roomSummaryProvider = RoomSummaryProvider(roomListService: roomListService, roomSummaryProvider = RoomSummaryProvider(roomListService: roomListService,
eventStringBuilder: eventStringBuilder, eventStringBuilder: eventStringBuilder,
name: "AllRooms", name: "AllRooms",
appSettings: appSettings,
notificationSettings: notificationSettings, notificationSettings: notificationSettings,
backgroundTaskService: backgroundTaskService) backgroundTaskService: backgroundTaskService)
try await roomSummaryProvider?.setRoomList(roomListService.allRooms()) try await roomSummaryProvider?.setRoomList(roomListService.allRooms())
@@ -413,7 +412,6 @@ class ClientProxy: ClientProxyProtocol {
inviteSummaryProvider = RoomSummaryProvider(roomListService: roomListService, inviteSummaryProvider = RoomSummaryProvider(roomListService: roomListService,
eventStringBuilder: eventStringBuilder, eventStringBuilder: eventStringBuilder,
name: "Invites", name: "Invites",
appSettings: appSettings,
notificationSettings: notificationSettings, notificationSettings: notificationSettings,
backgroundTaskService: backgroundTaskService) backgroundTaskService: backgroundTaskService)
try await inviteSummaryProvider?.setRoomList(roomListService.invites()) try await inviteSummaryProvider?.setRoomList(roomListService.invites())
@@ -22,7 +22,6 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol {
private let roomListService: RoomListServiceProtocol private let roomListService: RoomListServiceProtocol
private let eventStringBuilder: RoomEventStringBuilder private let eventStringBuilder: RoomEventStringBuilder
private let name: String private let name: String
private var appSettings: AppSettings
private let notificationSettings: NotificationSettingsProxyProtocol private let notificationSettings: NotificationSettingsProxyProtocol
private let backgroundTaskService: BackgroundTaskServiceProtocol private let backgroundTaskService: BackgroundTaskServiceProtocol
@@ -58,14 +57,12 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol {
init(roomListService: RoomListServiceProtocol, init(roomListService: RoomListServiceProtocol,
eventStringBuilder: RoomEventStringBuilder, eventStringBuilder: RoomEventStringBuilder,
name: String, name: String,
appSettings: AppSettings,
notificationSettings: NotificationSettingsProxyProtocol, notificationSettings: NotificationSettingsProxyProtocol,
backgroundTaskService: BackgroundTaskServiceProtocol) { backgroundTaskService: BackgroundTaskServiceProtocol) {
self.roomListService = roomListService self.roomListService = roomListService
serialDispatchQueue = DispatchQueue(label: "io.element.elementx.roomsummaryprovider", qos: .default) serialDispatchQueue = DispatchQueue(label: "io.element.elementx.roomsummaryprovider", qos: .default)
self.eventStringBuilder = eventStringBuilder self.eventStringBuilder = eventStringBuilder
self.name = name self.name = name
self.appSettings = appSettings
self.notificationSettings = notificationSettings self.notificationSettings = notificationSettings
self.backgroundTaskService = backgroundTaskService self.backgroundTaskService = backgroundTaskService
@@ -74,9 +71,7 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol {
.sink { [weak self] in self?.updateRoomsWithDiffs($0) } .sink { [weak self] in self?.updateRoomsWithDiffs($0) }
.store(in: &cancellables) .store(in: &cancellables)
if appSettings.notificationSettingsEnabled { setupNotificationSettingsSubscription()
setupNotificationSettingsSubscription()
}
} }
func setRoomList(_ roomList: RoomList) { func setRoomList(_ roomList: RoomList) {
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:274bb0078f8a151058043897f4e7bcb77e829707e8c79881e6055b9bbed6a9c1 oid sha256:1ad49c2d88bc1984b710b321481828dda71a962dfcf11b90b2da4d7870e9a6b2
size 92437 size 106363
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:a7764e39c3df507246e0312e4d65dbf1eee09486e69b8d2aee1d86b6c3632173 oid sha256:6ea76f09c518013c51a60a6907d6df7c11b774c8ce8f2e19719cfffe73fa37ff
size 107609 size 119954
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:b8b39f26310f411a198277dd56c86d697d1fc2a1c481de578bd9a22306881125 oid sha256:83881fdbc2208c211ca1fce3ec71b5a4db809581e6d6a5019de691aee94c2143
size 110753 size 122667
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:5c0dd4d17f991a4b85159f9443a29c3174672a2c4a283cb6f99c74507d80267c oid sha256:8c7f944dd4213ea07885e3bf37a055c95151676933a435720fd0dbd1a75158b7
size 97920 size 111882
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:dc84e5329532d7ceb2bd86ed36f92a81e8351f1de261496762f83cbb259b8b7a oid sha256:a22b15630bfb076b2b3e185a36d5e9faee749c27cfcfb55870df0678da1e7d0e
size 115979 size 127591
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:def07d1e06e120aee1988eae5212f018be8437aa24044941c9b6b8db58d2324a oid sha256:f20481300c914fe13fb7e3fdf1fa717eaa6020bfd8ed60a72e08d13c31e4268d
size 119392 size 125054
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:688cb467fc96dfff19c39075cf9a87159c64d02ae5e556a9fe902f9332dcba7a oid sha256:20f6abde898f96b22d8e7e8032050ab2760a39c6508a0a3c31185eeea99fc12d
size 144003 size 151262
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:8d6b82a9efbadb6843638223aa096ae2c4236a915e7c4f2fab4c88f28d235b43 oid sha256:ffde28c0f042f7cfc608666845fb3fe1cf7c5240597a06a7465279b023034991
size 114023 size 130532
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:90aefb602146db2b9b35e1d48f5fe1fa6158f5fc9e610685764a0951e7488a39 oid sha256:9551f149c3ce1e4ab2e6f5c54a71686a3b0b1277ec61890e254eebabfdb4ae80
size 136987 size 146451
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:a0f44c495b3cf91392ca144a313c991871f3f4a3c015a5493abe2fb1d42c8823 oid sha256:4480035eb9a3d13af063f3abd1bc4cbd4dc39b28aa58d4cf8b3f07d3525a6c1f
size 139719 size 148071
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:5c2b8fd204bd3615c4d099768079a3fae28acc3f8c0668b4b3570f2d30f81226 oid sha256:e947a5a3b6fadba3465f5eaa739da96375545872b0dd363c690ef6f9834ba8e4
size 122067 size 140774
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:0b709af1401cfca7e76e8d5775db127d794beb7b5a0b816a78ebed8bdb2cca89 oid sha256:aea2234bd284c4c88d4c04522676f56c8c081647c5f71bff7c8bb70742268b38
size 148719 size 157599
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:79777f9421513a5d387bb3cc54ac35da75a8c3a1a6dafcaa064dbd9abe288ab7 oid sha256:aaf929e8bdc8b03ebf11525500191824f1040dc8c121569dfc8595c3cb7fc28c
size 147694 size 157735
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:e82f958962f07fce1075b72f9160e253989e2042a7707360ae28393a5544ccbc oid sha256:b5a26343548e891d430a329d959d3f9c307324d825acbf382c55c25f1172e384
size 128129 size 143645
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:9d815b977d8be31b87684c610da757e2e8389ccc9e82070867f58337f2868227 oid sha256:4ee0263916f4d46830d5baa235aa60b1e44609a6d453f4f0afbce2c54da75530
size 105200 size 120976
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:4b390c1b74ec7f33edfbba06401d69667c4ed391ce6e042051440c82e5233792 oid sha256:4d9a6895bbce62827d21912b71eed3bf688b6f639a9a789a1256e636250d3602
size 121126 size 134504
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:1cc2e48c7ada9bb111857c7104b6ac106bb74568db73b38288cbc43d495880be oid sha256:8d0c404f34f3fd592ae188396953a5bf4a9d6d57892ec342f4be6f83a69d05bd
size 125491 size 138413
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:7e35677f4a0c829478d54339f4937825fb54ac6bb9804a31e0a7ac9b34b9779d oid sha256:10638b4d909b868d9184537718542b542474ba0b216463248d03592b66774d0b
size 110976 size 126956
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:86d7ba9ce9b8745510e218f8b22a53e57f20459a7a50af2a0eb13eff7e8c80eb oid sha256:55eb4abacf1221513826cc4eeb80686e1d37715fc6d54777b034eff481e92f06
size 129148 size 142290
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:d173fb278106eda74b32e617b00a62a69b5c37a15c4e0d948d24fc0459c5ec32 oid sha256:9c5452c2d00c015a7b316fa4f46c266d549556239fc8532b53207d6f4c466dc0
size 126776 size 132686
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:7b8c1a89fc960a9f62df4e2d67c7fc5ac35088772adb5b5621306457b7427942 oid sha256:b8d2815692b4c377de488c93be321d51cdffa4604bba0c20d57876a40426368b
size 145836 size 154039
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:96bcf695cd1594d97b427b080d5055d2dcb408291277dc1302274dedc7b4ae9f oid sha256:2ca45d62287196bf84f4c1b2bda5db76f5adb91d6ed38759fbe32ff4e323e14d
size 143250 size 167170
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:14b719940a2d55d51291830227a0b9e9f7a5a5fe942a3ecc119407f40458398a oid sha256:07dfcb650d3e3f914d06f21b9b3dd51bd1f8f72763534235aca1dab03b1aae0a
size 169433 size 174124
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:d721ab3fb80283367fb3b0573d223589197767e98d03da7d860b6107d59ee99b oid sha256:df89c61a27e2e74e0850fce3bbe7b37dae87fe9c57d78d3d54c0685b9dc4a9f3
size 163565 size 161800
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:658caaf88a93c43aa101978c0986f36a85e547c73103183708235896c6a509c5 oid sha256:862c6810149dac38a50831e4043cc44222c206c5a455462e96fe6aecb70269ec
size 151764 size 171409
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:ca7c609cdb53f3a73ad84aaa7237655a5eb1d485a5442afe763a654b2a0d3306 oid sha256:5a38546ccbd7c851cc7e5dfd384ece0dd5a93e4943e6fea12d8b7dbd54d76bd3
size 178599 size 182010
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:2b42fecf8963190981e3236a369bd1d601e6b6f7f1f9d3db17a9c5b2a3def601 oid sha256:4f904c2bcde574050c25f62386c05084264928bc81d387a7b66ee7447bffea11
size 177000 size 187727
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1 version https://git-lfs.github.com/spec/v1
oid sha256:e9c0cfe17aa68f760a3d79dd342ba4c123a3d34809a45735a26a3a2b752a3c73 oid sha256:3bd6944ace15d71da90b5ea36a47da841c2c6d2fe1baf66f1141e65956b8d640
size 129721 size 147878
@@ -34,8 +34,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase {
roomProxy: roomProxyMock, roomProxy: roomProxyMock,
mediaProvider: MockMediaProvider(), mediaProvider: MockMediaProvider(),
userIndicatorController: ServiceLocator.shared.userIndicatorController, userIndicatorController: ServiceLocator.shared.userIndicatorController,
notificationSettingsProxy: notificationSettingsProxyMock, notificationSettingsProxy: notificationSettingsProxyMock)
appSettings: AppSettings())
AppSettings.reset() AppSettings.reset()
} }
@@ -47,8 +46,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase {
roomProxy: roomProxyMock, roomProxy: roomProxyMock,
mediaProvider: MockMediaProvider(), mediaProvider: MockMediaProvider(),
userIndicatorController: ServiceLocator.shared.userIndicatorController, userIndicatorController: ServiceLocator.shared.userIndicatorController,
notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()), notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()))
appSettings: AppSettings())
let deferred = deferFulfillment(context.$viewState.collect(2).first()) let deferred = deferFulfillment(context.$viewState.collect(2).first())
context.send(viewAction: .processTapLeave) context.send(viewAction: .processTapLeave)
let states = try await deferred.fulfill() let states = try await deferred.fulfill()
@@ -65,8 +63,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase {
roomProxy: roomProxyMock, roomProxy: roomProxyMock,
mediaProvider: MockMediaProvider(), mediaProvider: MockMediaProvider(),
userIndicatorController: ServiceLocator.shared.userIndicatorController, userIndicatorController: ServiceLocator.shared.userIndicatorController,
notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()), notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()))
appSettings: AppSettings())
let deferred = deferFulfillment(context.$viewState.collect(2).first()) let deferred = deferFulfillment(context.$viewState.collect(2).first())
context.send(viewAction: .processTapLeave) context.send(viewAction: .processTapLeave)
let states = try await deferred.fulfill() let states = try await deferred.fulfill()
@@ -123,8 +120,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase {
roomProxy: roomProxyMock, roomProxy: roomProxyMock,
mediaProvider: MockMediaProvider(), mediaProvider: MockMediaProvider(),
userIndicatorController: ServiceLocator.shared.userIndicatorController, userIndicatorController: ServiceLocator.shared.userIndicatorController,
notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()), notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()))
appSettings: AppSettings())
await context.nextViewState() await context.nextViewState()
XCTAssertEqual(context.viewState.dmRecipient, RoomMemberDetails(withProxy: recipient)) XCTAssertEqual(context.viewState.dmRecipient, RoomMemberDetails(withProxy: recipient))
} }
@@ -141,8 +137,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase {
roomProxy: roomProxyMock, roomProxy: roomProxyMock,
mediaProvider: MockMediaProvider(), mediaProvider: MockMediaProvider(),
userIndicatorController: ServiceLocator.shared.userIndicatorController, userIndicatorController: ServiceLocator.shared.userIndicatorController,
notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()), notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()))
appSettings: AppSettings())
await context.nextViewState() await context.nextViewState()
XCTAssertEqual(context.viewState.dmRecipient, RoomMemberDetails(withProxy: recipient)) XCTAssertEqual(context.viewState.dmRecipient, RoomMemberDetails(withProxy: recipient))
@@ -168,8 +163,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase {
roomProxy: roomProxyMock, roomProxy: roomProxyMock,
mediaProvider: MockMediaProvider(), mediaProvider: MockMediaProvider(),
userIndicatorController: ServiceLocator.shared.userIndicatorController, userIndicatorController: ServiceLocator.shared.userIndicatorController,
notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()), notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()))
appSettings: AppSettings())
await context.nextViewState() await context.nextViewState()
XCTAssertEqual(context.viewState.dmRecipient, RoomMemberDetails(withProxy: recipient)) XCTAssertEqual(context.viewState.dmRecipient, RoomMemberDetails(withProxy: recipient))
@@ -196,8 +190,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase {
roomProxy: roomProxyMock, roomProxy: roomProxyMock,
mediaProvider: MockMediaProvider(), mediaProvider: MockMediaProvider(),
userIndicatorController: ServiceLocator.shared.userIndicatorController, userIndicatorController: ServiceLocator.shared.userIndicatorController,
notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()), notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()))
appSettings: AppSettings())
await context.nextViewState() await context.nextViewState()
XCTAssertEqual(context.viewState.dmRecipient, RoomMemberDetails(withProxy: recipient)) XCTAssertEqual(context.viewState.dmRecipient, RoomMemberDetails(withProxy: recipient))
@@ -223,8 +216,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase {
roomProxy: roomProxyMock, roomProxy: roomProxyMock,
mediaProvider: MockMediaProvider(), mediaProvider: MockMediaProvider(),
userIndicatorController: ServiceLocator.shared.userIndicatorController, userIndicatorController: ServiceLocator.shared.userIndicatorController,
notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()), notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()))
appSettings: AppSettings())
await context.nextViewState() await context.nextViewState()
XCTAssertEqual(context.viewState.dmRecipient, RoomMemberDetails(withProxy: recipient)) XCTAssertEqual(context.viewState.dmRecipient, RoomMemberDetails(withProxy: recipient))
@@ -250,8 +242,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase {
roomProxy: roomProxyMock, roomProxy: roomProxyMock,
mediaProvider: MockMediaProvider(), mediaProvider: MockMediaProvider(),
userIndicatorController: ServiceLocator.shared.userIndicatorController, userIndicatorController: ServiceLocator.shared.userIndicatorController,
notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()), notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()))
appSettings: AppSettings())
_ = await context.$viewState.debounce(for: .milliseconds(100), scheduler: DispatchQueue.main).values.first() _ = await context.$viewState.debounce(for: .milliseconds(100), scheduler: DispatchQueue.main).values.first()
@@ -265,8 +256,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase {
roomProxy: roomProxyMock, roomProxy: roomProxyMock,
mediaProvider: MockMediaProvider(), mediaProvider: MockMediaProvider(),
userIndicatorController: ServiceLocator.shared.userIndicatorController, userIndicatorController: ServiceLocator.shared.userIndicatorController,
notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()), notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()))
appSettings: AppSettings())
_ = await context.$viewState.debounce(for: .milliseconds(100), scheduler: DispatchQueue.main).values.first() _ = await context.$viewState.debounce(for: .milliseconds(100), scheduler: DispatchQueue.main).values.first()
@@ -295,8 +285,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase {
roomProxy: roomProxyMock, roomProxy: roomProxyMock,
mediaProvider: MockMediaProvider(), mediaProvider: MockMediaProvider(),
userIndicatorController: ServiceLocator.shared.userIndicatorController, userIndicatorController: ServiceLocator.shared.userIndicatorController,
notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()), notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()))
appSettings: AppSettings())
_ = await context.$viewState.debounce(for: .milliseconds(100), scheduler: DispatchQueue.main).values.first() _ = await context.$viewState.debounce(for: .milliseconds(100), scheduler: DispatchQueue.main).values.first()
@@ -314,8 +303,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase {
roomProxy: roomProxyMock, roomProxy: roomProxyMock,
mediaProvider: MockMediaProvider(), mediaProvider: MockMediaProvider(),
userIndicatorController: ServiceLocator.shared.userIndicatorController, userIndicatorController: ServiceLocator.shared.userIndicatorController,
notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()), notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()))
appSettings: AppSettings())
_ = await context.$viewState.debounce(for: .milliseconds(100), scheduler: DispatchQueue.main).values.first() _ = await context.$viewState.debounce(for: .milliseconds(100), scheduler: DispatchQueue.main).values.first()
@@ -333,8 +321,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase {
roomProxy: roomProxyMock, roomProxy: roomProxyMock,
mediaProvider: MockMediaProvider(), mediaProvider: MockMediaProvider(),
userIndicatorController: ServiceLocator.shared.userIndicatorController, userIndicatorController: ServiceLocator.shared.userIndicatorController,
notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()), notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()))
appSettings: AppSettings())
_ = await context.$viewState.debounce(for: .milliseconds(100), scheduler: DispatchQueue.main).values.first() _ = await context.$viewState.debounce(for: .milliseconds(100), scheduler: DispatchQueue.main).values.first()
@@ -352,8 +339,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase {
roomProxy: roomProxyMock, roomProxy: roomProxyMock,
mediaProvider: MockMediaProvider(), mediaProvider: MockMediaProvider(),
userIndicatorController: ServiceLocator.shared.userIndicatorController, userIndicatorController: ServiceLocator.shared.userIndicatorController,
notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()), notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()))
appSettings: AppSettings())
_ = await context.$viewState.debounce(for: .milliseconds(100), scheduler: DispatchQueue.main).values.first() _ = await context.$viewState.debounce(for: .milliseconds(100), scheduler: DispatchQueue.main).values.first()
@@ -370,8 +356,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase {
roomProxy: roomProxyMock, roomProxy: roomProxyMock,
mediaProvider: MockMediaProvider(), mediaProvider: MockMediaProvider(),
userIndicatorController: ServiceLocator.shared.userIndicatorController, userIndicatorController: ServiceLocator.shared.userIndicatorController,
notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()), notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()))
appSettings: AppSettings())
_ = await context.$viewState.debounce(for: .milliseconds(100), scheduler: DispatchQueue.main).values.first() _ = await context.$viewState.debounce(for: .milliseconds(100), scheduler: DispatchQueue.main).values.first()
@@ -386,8 +371,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase {
roomProxy: roomProxyMock, roomProxy: roomProxyMock,
mediaProvider: MockMediaProvider(), mediaProvider: MockMediaProvider(),
userIndicatorController: ServiceLocator.shared.userIndicatorController, userIndicatorController: ServiceLocator.shared.userIndicatorController,
notificationSettingsProxy: notificationSettingsProxyMock, notificationSettingsProxy: notificationSettingsProxyMock)
appSettings: AppSettings())
let deferred = deferFulfillment(context.$viewState.map(\.notificationSettingsState) let deferred = deferFulfillment(context.$viewState.map(\.notificationSettingsState)
.filter(\.isError) .filter(\.isError)
.first()) .first())