diff --git a/ElementX.xcodeproj/project.pbxproj b/ElementX.xcodeproj/project.pbxproj index e0da4e2e9..1deacd489 100644 --- a/ElementX.xcodeproj/project.pbxproj +++ b/ElementX.xcodeproj/project.pbxproj @@ -6828,8 +6828,8 @@ isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/matrix-org/matrix-analytics-events"; requirement = { - kind = revision; - revision = ad2b2d2b221bab89bf6443aafb925d52e30f4f6d; + kind = upToNextMinorVersion; + minimumVersion = 0.11.0; }; }; C13F55E4518415CB4C278E73 /* XCRemoteSwiftPackageReference "DTCoreText" */ = { diff --git a/ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 34e1392e2..f843cb7f8 100644 --- a/ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -121,7 +121,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/matrix-org/matrix-analytics-events", "state" : { - "revision" : "ad2b2d2b221bab89bf6443aafb925d52e30f4f6d" + "revision" : "354562b5cabf2b9aec6cbb12e3a614490b3cc6e8", + "version" : "0.11.0" } }, { @@ -262,7 +263,7 @@ { "identity" : "swiftui-introspect", "kind" : "remoteSourceControl", - "location" : "https://github.com/siteline/SwiftUI-Introspect", + "location" : "https://github.com/siteline/SwiftUI-Introspect.git", "state" : { "revision" : "b94da693e57eaf79d16464b8b7c90d09cba4e290", "version" : "0.9.2" diff --git a/ElementX/Sources/Application/AppSettings.swift b/ElementX/Sources/Application/AppSettings.swift index fdabc82bb..3f33ceebd 100644 --- a/ElementX/Sources/Application/AppSettings.swift +++ b/ElementX/Sources/Application/AppSettings.swift @@ -49,6 +49,7 @@ final class AppSettings { case mentionsBadgeEnabled case roomListFiltersEnabled case markAsUnreadEnabled + case markAsFavouriteEnabled } private static var suiteName: String = InfoPlistReader.main.appGroupIdentifier @@ -285,6 +286,9 @@ final class AppSettings { @UserPreference(key: UserDefaultsKeys.markAsUnreadEnabled, defaultValue: false, storageType: .userDefaults(store)) var markAsUnreadEnabled + @UserPreference(key: UserDefaultsKeys.markAsFavouriteEnabled, defaultValue: false, storageType: .userDefaults(store)) + var markAsFavouriteEnabled + #endif // MARK: - Shared diff --git a/ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift b/ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift index 02c53f028..a84e5adad 100644 --- a/ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift +++ b/ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift @@ -410,7 +410,7 @@ class RoomFlowCoordinator: FlowCoordinatorProtocol { Task { // Flag the room as read on entering, the timeline will take care of the read receipts - await roomProxy.flagAsRead() + await roomProxy.flagAsUnread(false) } let userID = userSession.clientProxy.userID @@ -523,6 +523,7 @@ class RoomFlowCoordinator: FlowCoordinatorProtocol { let params = RoomDetailsScreenCoordinatorParameters(accountUserID: userSession.userID, roomProxy: roomProxy, mediaProvider: userSession.mediaProvider, + analyticsService: analytics, userIndicatorController: userIndicatorController, notificationSettings: userSession.clientProxy.notificationSettings, attributedStringBuilder: AttributedStringBuilder(permalinkBaseURL: appSettings.permalinkBaseURL, diff --git a/ElementX/Sources/Mocks/Generated/GeneratedMocks.swift b/ElementX/Sources/Mocks/Generated/GeneratedMocks.swift index e70ff9ced..be42d8b27 100644 --- a/ElementX/Sources/Mocks/Generated/GeneratedMocks.swift +++ b/ElementX/Sources/Mocks/Generated/GeneratedMocks.swift @@ -1851,6 +1851,23 @@ class RoomProxyMock: RoomProxyProtocol { set(value) { underlyingIsEncrypted = value } } var underlyingIsEncrypted: Bool! + var isFavouriteCallsCount = 0 + var isFavouriteCalled: Bool { + return isFavouriteCallsCount > 0 + } + + var isFavourite: Bool { + get async { + isFavouriteCallsCount += 1 + if let isFavouriteClosure = isFavouriteClosure { + return await isFavouriteClosure() + } else { + return underlyingIsFavourite + } + } + } + var underlyingIsFavourite: Bool! + var isFavouriteClosure: (() async -> Bool)? var membership: Membership { get { return underlyingMembership } set(value) { underlyingMembership = value } @@ -2237,40 +2254,6 @@ class RoomProxyMock: RoomProxyProtocol { return canUserTriggerRoomNotificationUserIDReturnValue } } - //MARK: - flagAsUnread - - var flagAsUnreadCallsCount = 0 - var flagAsUnreadCalled: Bool { - return flagAsUnreadCallsCount > 0 - } - var flagAsUnreadReturnValue: Result! - var flagAsUnreadClosure: (() async -> Result)? - - func flagAsUnread() async -> Result { - flagAsUnreadCallsCount += 1 - if let flagAsUnreadClosure = flagAsUnreadClosure { - return await flagAsUnreadClosure() - } else { - return flagAsUnreadReturnValue - } - } - //MARK: - flagAsRead - - var flagAsReadCallsCount = 0 - var flagAsReadCalled: Bool { - return flagAsReadCallsCount > 0 - } - var flagAsReadReturnValue: Result! - var flagAsReadClosure: (() async -> Result)? - - func flagAsRead() async -> Result { - flagAsReadCallsCount += 1 - if let flagAsReadClosure = flagAsReadClosure { - return await flagAsReadClosure() - } else { - return flagAsReadReturnValue - } - } //MARK: - markAsRead var markAsReadReceiptTypeCallsCount = 0 @@ -2314,6 +2297,48 @@ class RoomProxyMock: RoomProxyProtocol { return sendTypingNotificationIsTypingReturnValue } } + //MARK: - flagAsUnread + + var flagAsUnreadCallsCount = 0 + var flagAsUnreadCalled: Bool { + return flagAsUnreadCallsCount > 0 + } + var flagAsUnreadReceivedIsUnread: Bool? + var flagAsUnreadReceivedInvocations: [Bool] = [] + var flagAsUnreadReturnValue: Result! + var flagAsUnreadClosure: ((Bool) async -> Result)? + + func flagAsUnread(_ isUnread: Bool) async -> Result { + flagAsUnreadCallsCount += 1 + flagAsUnreadReceivedIsUnread = isUnread + flagAsUnreadReceivedInvocations.append(isUnread) + if let flagAsUnreadClosure = flagAsUnreadClosure { + return await flagAsUnreadClosure(isUnread) + } else { + return flagAsUnreadReturnValue + } + } + //MARK: - flagAsFavourite + + var flagAsFavouriteCallsCount = 0 + var flagAsFavouriteCalled: Bool { + return flagAsFavouriteCallsCount > 0 + } + var flagAsFavouriteReceivedIsFavourite: Bool? + var flagAsFavouriteReceivedInvocations: [Bool] = [] + var flagAsFavouriteReturnValue: Result! + var flagAsFavouriteClosure: ((Bool) async -> Result)? + + func flagAsFavourite(_ isFavourite: Bool) async -> Result { + flagAsFavouriteCallsCount += 1 + flagAsFavouriteReceivedIsFavourite = isFavourite + flagAsFavouriteReceivedInvocations.append(isFavourite) + if let flagAsFavouriteClosure = flagAsFavouriteClosure { + return await flagAsFavouriteClosure(isFavourite) + } else { + return flagAsFavouriteReturnValue + } + } //MARK: - canUserJoinCall var canUserJoinCallUserIDCallsCount = 0 diff --git a/ElementX/Sources/Mocks/RoomProxyMock.swift b/ElementX/Sources/Mocks/RoomProxyMock.swift index fbe226dd0..fb65ea8e6 100644 --- a/ElementX/Sources/Mocks/RoomProxyMock.swift +++ b/ElementX/Sources/Mocks/RoomProxyMock.swift @@ -81,9 +81,10 @@ extension RoomProxyMock { canUserTriggerRoomNotificationUserIDReturnValue = .success(configuration.canUserTriggerRoomNotification) canUserJoinCallUserIDReturnValue = .success(configuration.canUserJoinCall) - flagAsReadReturnValue = .success(()) flagAsUnreadReturnValue = .success(()) markAsReadReceiptTypeReturnValue = .success(()) + underlyingIsFavourite = false + flagAsFavouriteReturnValue = .success(()) let widgetDriver = ElementCallWidgetDriverMock() widgetDriver.underlyingMessagePublisher = .init() diff --git a/ElementX/Sources/Other/AccessibilityIdentifiers.swift b/ElementX/Sources/Other/AccessibilityIdentifiers.swift index 80ff5f6e8..1ebe27095 100644 --- a/ElementX/Sources/Other/AccessibilityIdentifiers.swift +++ b/ElementX/Sources/Other/AccessibilityIdentifiers.swift @@ -172,7 +172,8 @@ enum A11yIdentifiers { let people = "room_details-people" let invite = "room_details-invite" let notifications = "room_details-notifications" - let pollsHistory = "romm_details-polls_history" + let pollsHistory = "room_details-polls_history" + let favourite = "room_details-favourite" } struct RoomMemberDetailsScreen { diff --git a/ElementX/Sources/Other/SwiftUI/Animation/ShimmerModifier.swift b/ElementX/Sources/Other/SwiftUI/Animation/ShimmerModifier.swift index 9d63f6245..d282642c7 100644 --- a/ElementX/Sources/Other/SwiftUI/Animation/ShimmerModifier.swift +++ b/ElementX/Sources/Other/SwiftUI/Animation/ShimmerModifier.swift @@ -79,8 +79,9 @@ struct ShimmerOverlay_Previews: PreviewProvider, TestablePreview { static let viewModel = HomeScreenViewModel(userSession: MockUserSession(clientProxy: MockClientProxy(userID: ""), mediaProvider: MockMediaProvider(), voiceMessageMediaManager: VoiceMessageMediaManagerMock()), - selectedRoomPublisher: CurrentValueSubject(nil).asCurrentValuePublisher(), + analyticsService: ServiceLocator.shared.analytics, appSettings: ServiceLocator.shared.settings, + selectedRoomPublisher: CurrentValueSubject(nil).asCurrentValuePublisher(), userIndicatorController: ServiceLocator.shared.userIndicatorController) static var previews: some View { diff --git a/ElementX/Sources/Screens/HomeScreen/HomeScreenCoordinator.swift b/ElementX/Sources/Screens/HomeScreen/HomeScreenCoordinator.swift index 30d68f923..1d4d510c2 100644 --- a/ElementX/Sources/Screens/HomeScreen/HomeScreenCoordinator.swift +++ b/ElementX/Sources/Screens/HomeScreen/HomeScreenCoordinator.swift @@ -53,8 +53,9 @@ final class HomeScreenCoordinator: CoordinatorProtocol { init(parameters: HomeScreenCoordinatorParameters) { viewModel = HomeScreenViewModel(userSession: parameters.userSession, - selectedRoomPublisher: parameters.selectedRoomPublisher, + analyticsService: ServiceLocator.shared.analytics, appSettings: ServiceLocator.shared.settings, + selectedRoomPublisher: parameters.selectedRoomPublisher, userIndicatorController: ServiceLocator.shared.userIndicatorController) bugReportService = parameters.bugReportService diff --git a/ElementX/Sources/Screens/HomeScreen/HomeScreenModels.swift b/ElementX/Sources/Screens/HomeScreen/HomeScreenModels.swift index 6c7a19164..56e69e75a 100644 --- a/ElementX/Sources/Screens/HomeScreen/HomeScreenModels.swift +++ b/ElementX/Sources/Screens/HomeScreen/HomeScreenModels.swift @@ -53,6 +53,7 @@ enum HomeScreenViewAction { case globalSearch case markRoomAsUnread(roomIdentifier: String) case markRoomAsRead(roomIdentifier: String) + case markRoomAsFavourite(roomIdentifier: String, isFavourite: Bool) } enum HomeScreenRoomListMode: CustomStringConvertible { @@ -95,6 +96,7 @@ struct HomeScreenViewState: BindableState { var shouldShowFilters = false var markAsUnreadEnabled = false + var markAsFavouriteEnabled = false var hasPendingInvitations = false var hasUnreadPendingInvitations = false @@ -154,6 +156,8 @@ struct HomeScreenRoom: Identifiable, Equatable { let isHighlighted: Bool + let isFavourite: Bool + var timestamp: String? var lastMessage: AttributedString? @@ -168,6 +172,7 @@ struct HomeScreenRoom: Identifiable, Equatable { name: "Placeholder room name", badges: .init(isDotShown: false, isMentionShown: false, isMuteShown: false, isCallShown: false), isHighlighted: false, + isFavourite: false, timestamp: "Now", lastMessage: placeholderLastMessage, isPlaceholder: true) @@ -194,6 +199,7 @@ extension HomeScreenRoom { isMuteShown: isMuteShown, isCallShown: isCallShown), isHighlighted: isHighlighted, + isFavourite: details.isFavourite, timestamp: details.lastMessageFormattedTimestamp, lastMessage: details.lastMessage, avatarURL: details.avatarURL) diff --git a/ElementX/Sources/Screens/HomeScreen/HomeScreenViewModel.swift b/ElementX/Sources/Screens/HomeScreen/HomeScreenViewModel.swift index 640556d37..643a1a2b4 100644 --- a/ElementX/Sources/Screens/HomeScreen/HomeScreenViewModel.swift +++ b/ElementX/Sources/Screens/HomeScreen/HomeScreenViewModel.swift @@ -21,6 +21,7 @@ typealias HomeScreenViewModelType = StateStoreViewModel, + analyticsService: AnalyticsService, appSettings: AppSettings, + selectedRoomPublisher: CurrentValuePublisher, userIndicatorController: UserIndicatorControllerProtocol) { self.userSession = userSession + self.analyticsService = analyticsService self.appSettings = appSettings self.userIndicatorController = userIndicatorController @@ -115,6 +118,10 @@ class HomeScreenViewModel: HomeScreenViewModelType, HomeScreenViewModelProtocol .weakAssign(to: \.state.markAsUnreadEnabled, on: self) .store(in: &cancellables) + appSettings.$markAsFavouriteEnabled + .weakAssign(to: \.state.markAsFavouriteEnabled, on: self) + .store(in: &cancellables) + appSettings.$hideUnreadMessagesBadge .sink { [weak self] _ in self?.updateRooms() } .store(in: &cancellables) @@ -182,9 +189,9 @@ class HomeScreenViewModel: HomeScreenViewModelType, HomeScreenViewModelProtocol return } - switch await roomProxy.flagAsUnread() { + switch await roomProxy.flagAsUnread(true) { case .success: - ServiceLocator.shared.analytics.trackInteraction(name: .MobileRoomListRoomContextMenuUnreadToggle) + analyticsService.trackInteraction(name: .MobileRoomListRoomContextMenuUnreadToggle) case .failure(let error): MXLog.error("Failed marking room \(roomIdentifier) as unread with error: \(error)") } @@ -196,9 +203,9 @@ class HomeScreenViewModel: HomeScreenViewModelType, HomeScreenViewModelProtocol return } - switch await roomProxy.flagAsRead() { + switch await roomProxy.flagAsUnread(false) { case .success: - ServiceLocator.shared.analytics.trackInteraction(name: .MobileRoomListRoomContextMenuUnreadToggle) + analyticsService.trackInteraction(name: .MobileRoomListRoomContextMenuUnreadToggle) if case .failure(let error) = await roomProxy.markAsRead(receiptType: appSettings.sharePresence ? .read : .readPrivate) { MXLog.error("Failed marking room \(roomIdentifier) as read with error: \(error)") @@ -207,6 +214,10 @@ class HomeScreenViewModel: HomeScreenViewModelType, HomeScreenViewModelProtocol MXLog.error("Failed flagging room \(roomIdentifier) as read with error: \(error)") } } + case .markRoomAsFavourite(let roomIdentifier, let isFavourite): + Task { + await markRoomAsFavourite(roomIdentifier, isFavourite: isFavourite) + } } } @@ -241,7 +252,7 @@ class HomeScreenViewModel: HomeScreenViewModelType, HomeScreenViewModelProtocol return } - ServiceLocator.shared.analytics.signpost.beginFirstRooms() + analyticsService.signpost.beginFirstRooms() let hasUserBeenMigrated = appSettings.migratedAccounts[userSession.userID] == true @@ -322,7 +333,7 @@ class HomeScreenViewModel: HomeScreenViewModelType, HomeScreenViewModelProtocol } if roomListMode == .rooms, state.roomListMode == .skeletons { - ServiceLocator.shared.analytics.signpost.endFirstRooms() + analyticsService.signpost.endFirstRooms() } state.roomListMode = roomListMode @@ -399,6 +410,20 @@ class HomeScreenViewModel: HomeScreenViewModelType, HomeScreenViewModelProtocol roomSummaryProvider.updateVisibleRange(range) } + private func markRoomAsFavourite(_ roomID: String, isFavourite: Bool) async { + guard let roomProxy = await userSession.clientProxy.roomForIdentifier(roomID) else { + MXLog.error("Failed retrieving room for identifier: \(roomID)") + return + } + + switch await roomProxy.flagAsFavourite(isFavourite) { + case .success: + analyticsService.trackInteraction(name: .MobileRoomListRoomContextMenuFavouriteToggle) + case .failure(let error): + MXLog.error("Failed marking room \(roomID) as favourite: \(isFavourite) with error: \(error)") + } + } + private static let leaveRoomLoadingID = "LeaveRoomLoading" private func startLeaveRoomProcess(roomId: String) { diff --git a/ElementX/Sources/Screens/HomeScreen/View/HomeScreen.swift b/ElementX/Sources/Screens/HomeScreen/View/HomeScreen.swift index b9dbf9dc2..32c79cefe 100644 --- a/ElementX/Sources/Screens/HomeScreen/View/HomeScreen.swift +++ b/ElementX/Sources/Screens/HomeScreen/View/HomeScreen.swift @@ -238,8 +238,9 @@ struct HomeScreen_Previews: PreviewProvider, TestablePreview { voiceMessageMediaManager: VoiceMessageMediaManagerMock()) return HomeScreenViewModel(userSession: userSession, - selectedRoomPublisher: CurrentValueSubject(nil).asCurrentValuePublisher(), + analyticsService: ServiceLocator.shared.analytics, appSettings: appSettings, + selectedRoomPublisher: CurrentValueSubject(nil).asCurrentValuePublisher(), userIndicatorController: ServiceLocator.shared.userIndicatorController) } } diff --git a/ElementX/Sources/Screens/HomeScreen/View/HomeScreenEmptyStateView.swift b/ElementX/Sources/Screens/HomeScreen/View/HomeScreenEmptyStateView.swift index 385a6c7b2..655ebd3bb 100644 --- a/ElementX/Sources/Screens/HomeScreen/View/HomeScreenEmptyStateView.swift +++ b/ElementX/Sources/Screens/HomeScreen/View/HomeScreenEmptyStateView.swift @@ -155,8 +155,9 @@ struct HomeScreenEmptyStateView_Previews: PreviewProvider, TestablePreview { voiceMessageMediaManager: VoiceMessageMediaManagerMock()) return HomeScreenViewModel(userSession: userSession, - selectedRoomPublisher: CurrentValueSubject(nil).asCurrentValuePublisher(), + analyticsService: ServiceLocator.shared.analytics, appSettings: ServiceLocator.shared.settings, + selectedRoomPublisher: CurrentValueSubject(nil).asCurrentValuePublisher(), userIndicatorController: ServiceLocator.shared.userIndicatorController) }() } diff --git a/ElementX/Sources/Screens/HomeScreen/View/HomeScreenRecoveryKeyConfirmationBanner.swift b/ElementX/Sources/Screens/HomeScreen/View/HomeScreenRecoveryKeyConfirmationBanner.swift index c06010a1c..279fdfe8a 100644 --- a/ElementX/Sources/Screens/HomeScreen/View/HomeScreenRecoveryKeyConfirmationBanner.swift +++ b/ElementX/Sources/Screens/HomeScreen/View/HomeScreenRecoveryKeyConfirmationBanner.swift @@ -73,8 +73,9 @@ struct HomeScreenRecoveryKeyConfirmationBanner_Previews: PreviewProvider, Testab voiceMessageMediaManager: VoiceMessageMediaManagerMock()) return HomeScreenViewModel(userSession: userSession, - selectedRoomPublisher: CurrentValueSubject(nil).asCurrentValuePublisher(), + analyticsService: ServiceLocator.shared.analytics, appSettings: ServiceLocator.shared.settings, + selectedRoomPublisher: CurrentValueSubject(nil).asCurrentValuePublisher(), userIndicatorController: ServiceLocator.shared.userIndicatorController) } } diff --git a/ElementX/Sources/Screens/HomeScreen/View/HomeScreenRoomCell.swift b/ElementX/Sources/Screens/HomeScreen/View/HomeScreenRoomCell.swift index 92f13826d..d11454460 100644 --- a/ElementX/Sources/Screens/HomeScreen/View/HomeScreenRoomCell.swift +++ b/ElementX/Sources/Screens/HomeScreen/View/HomeScreenRoomCell.swift @@ -181,8 +181,9 @@ struct HomeScreenRoomCell_Previews: PreviewProvider, TestablePreview { voiceMessageMediaManager: VoiceMessageMediaManagerMock()) return HomeScreenViewModel(userSession: userSession, - selectedRoomPublisher: CurrentValueSubject(nil).asCurrentValuePublisher(), + analyticsService: ServiceLocator.shared.analytics, appSettings: ServiceLocator.shared.settings, + selectedRoomPublisher: CurrentValueSubject(nil).asCurrentValuePublisher(), userIndicatorController: ServiceLocator.shared.userIndicatorController) }() @@ -193,8 +194,9 @@ struct HomeScreenRoomCell_Previews: PreviewProvider, TestablePreview { voiceMessageMediaManager: VoiceMessageMediaManagerMock()) return HomeScreenViewModel(userSession: userSession, - selectedRoomPublisher: CurrentValueSubject(nil).asCurrentValuePublisher(), + analyticsService: ServiceLocator.shared.analytics, appSettings: ServiceLocator.shared.settings, + selectedRoomPublisher: CurrentValueSubject(nil).asCurrentValuePublisher(), userIndicatorController: ServiceLocator.shared.userIndicatorController) }() diff --git a/ElementX/Sources/Screens/HomeScreen/View/HomeScreenRoomList.swift b/ElementX/Sources/Screens/HomeScreen/View/HomeScreenRoomList.swift index 538d9e5d3..2d714d327 100644 --- a/ElementX/Sources/Screens/HomeScreen/View/HomeScreenRoomList.swift +++ b/ElementX/Sources/Screens/HomeScreen/View/HomeScreenRoomList.swift @@ -63,6 +63,22 @@ struct HomeScreenRoomList: View { } } + if context.viewState.markAsFavouriteEnabled { + if room.isFavourite { + Button { + context.send(viewAction: .markRoomAsFavourite(roomIdentifier: room.id, isFavourite: false)) + } label: { + Label(L10n.commonFavourited, icon: \.favouriteSolid) + } + } else { + Button { + context.send(viewAction: .markRoomAsFavourite(roomIdentifier: room.id, isFavourite: true)) + } label: { + Label(L10n.commonFavourite, icon: \.favourite) + } + } + } + Button { context.send(viewAction: .showRoomDetails(roomIdentifier: room.id)) } label: { diff --git a/ElementX/Sources/Screens/HomeScreen/View/HomeScreenSessionVerificationBanner.swift b/ElementX/Sources/Screens/HomeScreen/View/HomeScreenSessionVerificationBanner.swift index 9b2584fae..94b887fa5 100644 --- a/ElementX/Sources/Screens/HomeScreen/View/HomeScreenSessionVerificationBanner.swift +++ b/ElementX/Sources/Screens/HomeScreen/View/HomeScreenSessionVerificationBanner.swift @@ -73,8 +73,9 @@ struct HomeScreenSessionVerificationBanner_Previews: PreviewProvider, TestablePr voiceMessageMediaManager: VoiceMessageMediaManagerMock()) return HomeScreenViewModel(userSession: userSession, - selectedRoomPublisher: CurrentValueSubject(nil).asCurrentValuePublisher(), + analyticsService: ServiceLocator.shared.analytics, appSettings: ServiceLocator.shared.settings, + selectedRoomPublisher: CurrentValueSubject(nil).asCurrentValuePublisher(), userIndicatorController: ServiceLocator.shared.userIndicatorController) } } diff --git a/ElementX/Sources/Screens/InvitesScreen/View/InvitesScreenCell.swift b/ElementX/Sources/Screens/InvitesScreen/View/InvitesScreenCell.swift index 3091068c1..786823500 100644 --- a/ElementX/Sources/Screens/InvitesScreen/View/InvitesScreenCell.swift +++ b/ElementX/Sources/Screens/InvitesScreen/View/InvitesScreenCell.swift @@ -186,14 +186,15 @@ private extension InvitesScreenRoomDetails { avatarURL: nil, lastMessage: nil, lastMessageFormattedTimestamp: nil, - isMarkedUnread: false, unreadMessagesCount: 0, unreadMentionsCount: 0, unreadNotificationsCount: 0, notificationMode: nil, canonicalAlias: "#footest:somewhere.org", inviter: inviter, - hasOngoingCall: false) + hasOngoingCall: false, + isMarkedUnread: false, + isFavourite: false) return .init(roomDetails: dmRoom, isUnread: false) } @@ -209,14 +210,15 @@ private extension InvitesScreenRoomDetails { avatarURL: avatarURL, lastMessage: nil, lastMessageFormattedTimestamp: nil, - isMarkedUnread: false, unreadMessagesCount: 0, unreadMentionsCount: 0, unreadNotificationsCount: 0, notificationMode: nil, canonicalAlias: alias, inviter: inviter, - hasOngoingCall: false) + hasOngoingCall: false, + isMarkedUnread: false, + isFavourite: false) return .init(roomDetails: dmRoom, isUnread: isUnread) } } diff --git a/ElementX/Sources/Screens/RoomDetailsScreen/RoomDetailsScreenCoordinator.swift b/ElementX/Sources/Screens/RoomDetailsScreen/RoomDetailsScreenCoordinator.swift index 2a9a800e1..0c054009a 100644 --- a/ElementX/Sources/Screens/RoomDetailsScreen/RoomDetailsScreenCoordinator.swift +++ b/ElementX/Sources/Screens/RoomDetailsScreen/RoomDetailsScreenCoordinator.swift @@ -21,6 +21,7 @@ struct RoomDetailsScreenCoordinatorParameters { let accountUserID: String let roomProxy: RoomProxyProtocol let mediaProvider: MediaProviderProtocol + let analyticsService: AnalyticsService let userIndicatorController: UserIndicatorControllerProtocol let notificationSettings: NotificationSettingsProxyProtocol let attributedStringBuilder: AttributedStringBuilderProtocol @@ -49,6 +50,7 @@ final class RoomDetailsScreenCoordinator: CoordinatorProtocol { viewModel = RoomDetailsScreenViewModel(accountUserID: parameters.accountUserID, roomProxy: parameters.roomProxy, mediaProvider: parameters.mediaProvider, + analyticsService: parameters.analyticsService, userIndicatorController: parameters.userIndicatorController, notificationSettingsProxy: parameters.notificationSettings, attributedStringBuilder: parameters.attributedStringBuilder) diff --git a/ElementX/Sources/Screens/RoomDetailsScreen/RoomDetailsScreenModels.swift b/ElementX/Sources/Screens/RoomDetailsScreen/RoomDetailsScreenModels.swift index 878e14c97..6d31d9d3c 100644 --- a/ElementX/Sources/Screens/RoomDetailsScreen/RoomDetailsScreenModels.swift +++ b/ElementX/Sources/Screens/RoomDetailsScreen/RoomDetailsScreenModels.swift @@ -129,6 +129,8 @@ struct RoomDetailsScreenViewStateBindings { } } } + + var isFavourite = false /// Information describing the currently displayed alert. var alertInfo: AlertInfo? @@ -180,6 +182,7 @@ enum RoomDetailsScreenViewAction { case processToogleMuteNotifications case displayAvatar case processTapPolls + case toggleFavourite(isFavourite: Bool) } enum RoomDetailsScreenViewShortcut { diff --git a/ElementX/Sources/Screens/RoomDetailsScreen/RoomDetailsScreenViewModel.swift b/ElementX/Sources/Screens/RoomDetailsScreen/RoomDetailsScreenViewModel.swift index 3b73c13ba..c2e2a90fb 100644 --- a/ElementX/Sources/Screens/RoomDetailsScreen/RoomDetailsScreenViewModel.swift +++ b/ElementX/Sources/Screens/RoomDetailsScreen/RoomDetailsScreenViewModel.swift @@ -22,6 +22,7 @@ typealias RoomDetailsScreenViewModelType = StateStoreViewModel Result { - MXLog.info("Flagging room \(id) as unread") - do { - try await room.setUnreadFlag(newValue: true) - return .success(()) - } catch { - MXLog.error("Failed marking room \(id) as unread with error: \(error)") - return .failure(.failedFlaggingAsUnread) - } - } - - func flagAsRead() async -> Result { - MXLog.info("Flagging room \(id) as read") - - do { - try await room.setUnreadFlag(newValue: false) - return .success(()) - } catch { - MXLog.error("Failed marking room \(id) as read with error: \(error)") - return .failure(.failedFlaggingAsRead) - } - } - func markAsRead(receiptType: ReceiptType) async -> Result { do { try await room.markAsRead(receiptType: receiptType) @@ -414,6 +396,40 @@ class RoomProxy: RoomProxyProtocol { } } + // MARK: - Room flags + + func flagAsUnread(_ isUnread: Bool) async -> Result { + MXLog.info("Flagging room \(id) as unread: \(isUnread)") + + do { + try await room.setUnreadFlag(newValue: isUnread) + return .success(()) + } catch { + MXLog.error("Failed marking room \(id) as unread: \(isUnread) with error: \(error)") + return .failure(.failedFlaggingAsUnread) + } + } + + func getIsFavourite() async -> Result { + do { + let result = try await room.roomInfo().isFavourite + return .success(result) + } catch { + MXLog.error("Failed retrieving isFavourite for room: \(id) with error: \(error)") + return .failure(.failedRetrievingIsFavourite) + } + } + + func flagAsFavourite(_ isFavourite: Bool) async -> Result { + do { + try await room.setIsFavourite(isFavourite: isFavourite, tagOrder: nil) + return .success(()) + } catch { + MXLog.error("Failed flagging room \(id) as favourite with error: \(error)") + return .failure(.failedFlaggingAsFavourite) + } + } + // MARK: - Element Call func canUserJoinCall(userID: String) async -> Result { @@ -431,10 +447,10 @@ class RoomProxy: RoomProxyProtocol { // MARK: - Private - private func subscribeToRoomStateUpdates() { + private func subscribeToRoomInfoUpdates() { roomInfoObservationToken = room.subscribeToRoomInfoUpdates(listener: RoomInfoUpdateListener { [weak self] in MXLog.info("Received room info update") - self?.actionsSubject.send(.stateUpdate) + self?.actionsSubject.send(.roomInfoUpdate) }) } diff --git a/ElementX/Sources/Services/Room/RoomProxyProtocol.swift b/ElementX/Sources/Services/Room/RoomProxyProtocol.swift index a6000d4bb..56acb34f7 100644 --- a/ElementX/Sources/Services/Room/RoomProxyProtocol.swift +++ b/ElementX/Sources/Services/Room/RoomProxyProtocol.swift @@ -32,13 +32,14 @@ enum RoomProxyError: Error, Equatable { case failedUploadingAvatar case failedCheckingPermission case failedFlaggingAsUnread - case failedFlaggingAsRead case failedMarkingAsRead case failedSendingTypingNotice + case failedRetrievingIsFavourite + case failedFlaggingAsFavourite } enum RoomProxyAction { - case stateUpdate + case roomInfoUpdate } // sourcery: AutoMockable @@ -48,6 +49,7 @@ protocol RoomProxyProtocol { var isPublic: Bool { get } var isSpace: Bool { get } var isEncrypted: Bool { get } + var isFavourite: Bool { get async } var membership: Membership { get } var hasOngoingCall: Bool { get } var canonicalAlias: String? { get } @@ -109,15 +111,17 @@ protocol RoomProxyProtocol { func canUserTriggerRoomNotification(userID: String) async -> Result - func flagAsUnread() async -> Result - - func flagAsRead() async -> Result - func markAsRead(receiptType: ReceiptType) async -> Result /// https://spec.matrix.org/v1.9/client-server-api/#typing-notifications @discardableResult func sendTypingNotification(isTyping: Bool) async -> Result + // MARK: - Room Flags + + func flagAsUnread(_ isUnread: Bool) async -> Result + + func flagAsFavourite(_ isFavourite: Bool) async -> Result + // MARK: - Element Call func canUserJoinCall(userID: String) async -> Result diff --git a/ElementX/Sources/Services/Room/RoomSummary/MockRoomSummaryProvider.swift b/ElementX/Sources/Services/Room/RoomSummary/MockRoomSummaryProvider.swift index 338462de0..80d592c5b 100644 --- a/ElementX/Sources/Services/Room/RoomSummary/MockRoomSummaryProvider.swift +++ b/ElementX/Sources/Services/Room/RoomSummary/MockRoomSummaryProvider.swift @@ -83,98 +83,105 @@ extension Array where Element == RoomSummary { avatarURL: nil, lastMessage: AttributedString("I do not wish to take the trouble to understand mysticism"), lastMessageFormattedTimestamp: "14:56", - isMarkedUnread: false, unreadMessagesCount: 0, unreadMentionsCount: 0, unreadNotificationsCount: 0, notificationMode: .allMessages, canonicalAlias: nil, inviter: nil, - hasOngoingCall: false)), + hasOngoingCall: false, + isMarkedUnread: false, + isFavourite: false)), .filled(details: RoomSummaryDetails(id: "2", name: "Foundation and Empire", isDirect: true, avatarURL: URL.picturesDirectory, lastMessage: AttributedString("How do you see the Emperor then? You think he keeps office hours?"), lastMessageFormattedTimestamp: "2:56 PM", - isMarkedUnread: false, unreadMessagesCount: 2, unreadMentionsCount: 0, unreadNotificationsCount: 2, notificationMode: .mute, canonicalAlias: nil, inviter: nil, - hasOngoingCall: false)), + hasOngoingCall: false, + isMarkedUnread: false, + isFavourite: false)), .filled(details: RoomSummaryDetails(id: "3", name: "Second Foundation", isDirect: true, avatarURL: nil, lastMessage: try? AttributedString(markdown: "He certainly seemed no *mental genius* to me"), lastMessageFormattedTimestamp: "Some time ago", - isMarkedUnread: false, unreadMessagesCount: 3, unreadMentionsCount: 0, unreadNotificationsCount: 0, notificationMode: .mentionsAndKeywordsOnly, canonicalAlias: nil, inviter: nil, - hasOngoingCall: false)), + hasOngoingCall: false, + isMarkedUnread: false, + isFavourite: false)), .filled(details: RoomSummaryDetails(id: "4", name: "Foundation's Edge", isDirect: true, avatarURL: nil, lastMessage: AttributedString("There's an archaic measure of time that's called the month"), lastMessageFormattedTimestamp: "Just now", - isMarkedUnread: false, unreadMessagesCount: 2, unreadMentionsCount: 2, unreadNotificationsCount: 2, notificationMode: .allMessages, canonicalAlias: nil, inviter: nil, - hasOngoingCall: false)), + hasOngoingCall: false, + isMarkedUnread: false, + isFavourite: false)), .filled(details: RoomSummaryDetails(id: "5", name: "Foundation and Earth", isDirect: true, avatarURL: nil, lastMessage: AttributedString("Clearly, if Earth is powerful enough to do that, it might also be capable of adjusting minds in order to force belief in its radioactivity"), lastMessageFormattedTimestamp: "1986", - isMarkedUnread: false, unreadMessagesCount: 1, unreadMentionsCount: 1, unreadNotificationsCount: 1, notificationMode: .allMessages, canonicalAlias: nil, inviter: nil, - hasOngoingCall: true)), + hasOngoingCall: true, + isMarkedUnread: false, + isFavourite: false)), .filled(details: RoomSummaryDetails(id: "6", name: "Prelude to Foundation", isDirect: true, avatarURL: nil, lastMessage: AttributedString("Are you groping for the word 'paranoia'?"), lastMessageFormattedTimestamp: "きょうはじゅういちがつじゅういちにちです", - isMarkedUnread: false, unreadMessagesCount: 6, unreadMentionsCount: 0, unreadNotificationsCount: 0, notificationMode: .mute, canonicalAlias: nil, inviter: nil, - hasOngoingCall: true)), + hasOngoingCall: true, + isMarkedUnread: false, + isFavourite: false)), .filled(details: RoomSummaryDetails(id: "0", name: "Unknown", isDirect: false, avatarURL: nil, lastMessage: nil, lastMessageFormattedTimestamp: nil, - isMarkedUnread: false, unreadMessagesCount: 0, unreadMentionsCount: 0, unreadNotificationsCount: 0, notificationMode: nil, canonicalAlias: nil, inviter: nil, - hasOngoingCall: false)), + hasOngoingCall: false, + isMarkedUnread: false, + isFavourite: false)), .empty ] @@ -213,27 +220,29 @@ extension Array where Element == RoomSummary { avatarURL: URL.picturesDirectory, lastMessage: nil, lastMessageFormattedTimestamp: nil, - isMarkedUnread: false, unreadMessagesCount: 0, unreadMentionsCount: 0, unreadNotificationsCount: 0, notificationMode: nil, canonicalAlias: "#footest:somewhere.org", inviter: RoomMemberProxyMock.mockCharlie, - hasOngoingCall: false)), + hasOngoingCall: false, + isMarkedUnread: false, + isFavourite: false)), .filled(details: RoomSummaryDetails(id: "someAwesomeRoomId2", name: "Second room", isDirect: true, avatarURL: nil, lastMessage: nil, lastMessageFormattedTimestamp: nil, - isMarkedUnread: false, unreadMessagesCount: 0, unreadMentionsCount: 0, unreadNotificationsCount: 0, notificationMode: nil, canonicalAlias: nil, inviter: RoomMemberProxyMock.mockCharlie, - hasOngoingCall: false)) + hasOngoingCall: false, + isMarkedUnread: false, + isFavourite: false)) ] } diff --git a/ElementX/Sources/Services/Room/RoomSummary/RoomSummaryDetails.swift b/ElementX/Sources/Services/Room/RoomSummary/RoomSummaryDetails.swift index e75e6723d..30504333b 100644 --- a/ElementX/Sources/Services/Room/RoomSummary/RoomSummaryDetails.swift +++ b/ElementX/Sources/Services/Room/RoomSummary/RoomSummaryDetails.swift @@ -24,7 +24,6 @@ struct RoomSummaryDetails { let avatarURL: URL? let lastMessage: AttributedString? let lastMessageFormattedTimestamp: String? - let isMarkedUnread: Bool let unreadMessagesCount: UInt let unreadMentionsCount: UInt let unreadNotificationsCount: UInt @@ -33,6 +32,9 @@ struct RoomSummaryDetails { let inviter: RoomMemberProxyProtocol? let hasOngoingCall: Bool + let isMarkedUnread: Bool + let isFavourite: Bool + var hasUnreadMessages: Bool { unreadMessagesCount > 0 } var hasUnreadMentions: Bool { unreadMentionsCount > 0 } var hasUnreadNotifications: Bool { unreadNotificationsCount > 0 } @@ -60,7 +62,6 @@ extension RoomSummaryDetails { avatarURL = nil lastMessage = AttributedString(string) lastMessageFormattedTimestamp = "Now" - isMarkedUnread = false unreadMessagesCount = hasUnreadMessages ? 1 : 0 unreadMentionsCount = hasUnreadMentions ? 1 : 0 unreadNotificationsCount = hasUnreadNotifications ? 1 : 0 @@ -68,5 +69,8 @@ extension RoomSummaryDetails { canonicalAlias = nil inviter = nil hasOngoingCall = false + + isMarkedUnread = false + isFavourite = false } } diff --git a/ElementX/Sources/Services/Room/RoomSummary/RoomSummaryProvider.swift b/ElementX/Sources/Services/Room/RoomSummary/RoomSummaryProvider.swift index c998ce275..5f7194466 100644 --- a/ElementX/Sources/Services/Room/RoomSummary/RoomSummaryProvider.swift +++ b/ElementX/Sources/Services/Room/RoomSummary/RoomSummaryProvider.swift @@ -252,14 +252,15 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol { avatarURL: roomInfo.avatarUrl.flatMap(URL.init(string:)), lastMessage: attributedLastMessage, lastMessageFormattedTimestamp: lastMessageFormattedTimestamp, - isMarkedUnread: appSettings.markAsUnreadEnabled ? roomInfo.isMarkedUnread : false, unreadMessagesCount: appSettings.mentionsBadgeEnabled ? UInt(roomInfo.numUnreadMessages) : 0, unreadMentionsCount: appSettings.mentionsBadgeEnabled ? UInt(roomInfo.numUnreadMentions) : 0, unreadNotificationsCount: appSettings.mentionsBadgeEnabled ? UInt(roomInfo.numUnreadNotifications) : UInt(roomInfo.notificationCount), notificationMode: notificationMode, canonicalAlias: roomInfo.canonicalAlias, inviter: inviterProxy, - hasOngoingCall: roomInfo.hasRoomCall) + hasOngoingCall: roomInfo.hasRoomCall, + isMarkedUnread: appSettings.markAsUnreadEnabled ? roomInfo.isMarkedUnread : false, + isFavourite: roomInfo.isFavourite) return invalidated ? .invalidated(details: details) : .filled(details: details) } diff --git a/ElementX/Sources/UITests/UITestsAppCoordinator.swift b/ElementX/Sources/UITests/UITestsAppCoordinator.swift index 7f4536b46..202ef97c9 100644 --- a/ElementX/Sources/UITests/UITestsAppCoordinator.swift +++ b/ElementX/Sources/UITests/UITestsAppCoordinator.swift @@ -590,6 +590,7 @@ class MockScreen: Identifiable { let coordinator = RoomDetailsScreenCoordinator(parameters: .init(accountUserID: "@owner:somewhere.com", roomProxy: roomProxy, mediaProvider: MockMediaProvider(), + analyticsService: ServiceLocator.shared.analytics, userIndicatorController: ServiceLocator.shared.userIndicatorController, notificationSettings: NotificationSettingsProxyMock(with: .init()), attributedStringBuilder: AttributedStringBuilder(permalinkBaseURL: ServiceLocator.shared.settings.permalinkBaseURL, @@ -610,6 +611,7 @@ class MockScreen: Identifiable { let coordinator = RoomDetailsScreenCoordinator(parameters: .init(accountUserID: "@owner:somewhere.com", roomProxy: roomProxy, mediaProvider: MockMediaProvider(), + analyticsService: ServiceLocator.shared.analytics, userIndicatorController: ServiceLocator.shared.userIndicatorController, notificationSettings: NotificationSettingsProxyMock(with: .init()), attributedStringBuilder: AttributedStringBuilder(permalinkBaseURL: ServiceLocator.shared.settings.permalinkBaseURL, @@ -632,6 +634,7 @@ class MockScreen: Identifiable { let coordinator = RoomDetailsScreenCoordinator(parameters: .init(accountUserID: "@owner:somewhere.com", roomProxy: roomProxy, mediaProvider: MockMediaProvider(), + analyticsService: ServiceLocator.shared.analytics, userIndicatorController: ServiceLocator.shared.userIndicatorController, notificationSettings: NotificationSettingsProxyMock(with: .init()), attributedStringBuilder: AttributedStringBuilder(permalinkBaseURL: ServiceLocator.shared.settings.permalinkBaseURL, @@ -650,6 +653,7 @@ class MockScreen: Identifiable { let coordinator = RoomDetailsScreenCoordinator(parameters: .init(accountUserID: "@owner:somewhere.com", roomProxy: roomProxy, mediaProvider: MockMediaProvider(), + analyticsService: ServiceLocator.shared.analytics, userIndicatorController: ServiceLocator.shared.userIndicatorController, notificationSettings: NotificationSettingsProxyMock(with: .init()), attributedStringBuilder: AttributedStringBuilder(permalinkBaseURL: ServiceLocator.shared.settings.permalinkBaseURL, @@ -669,6 +673,7 @@ class MockScreen: Identifiable { let coordinator = RoomDetailsScreenCoordinator(parameters: .init(accountUserID: "@owner:somewhere.com", roomProxy: roomProxy, mediaProvider: MockMediaProvider(), + analyticsService: ServiceLocator.shared.analytics, userIndicatorController: ServiceLocator.shared.userIndicatorController, notificationSettings: NotificationSettingsProxyMock(with: .init()), attributedStringBuilder: AttributedStringBuilder(permalinkBaseURL: ServiceLocator.shared.settings.permalinkBaseURL, diff --git a/UITests/Sources/__Snapshots__/Application/en-GB-iPad-9th-generation.roomDetailsScreen.png b/UITests/Sources/__Snapshots__/Application/en-GB-iPad-9th-generation.roomDetailsScreen.png index 9d281731c..1873c47e8 100644 --- a/UITests/Sources/__Snapshots__/Application/en-GB-iPad-9th-generation.roomDetailsScreen.png +++ b/UITests/Sources/__Snapshots__/Application/en-GB-iPad-9th-generation.roomDetailsScreen.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e0f0d0153b192c9d39095958380d457e2cf2857fb7de3e385c48dba4b15219d2 -size 108327 +oid sha256:39bf0f198860337c27a796c6e1431f709471d4a3f6ccbb72309b9e4eaf9780b3 +size 115152 diff --git a/UITests/Sources/__Snapshots__/Application/en-GB-iPad-9th-generation.roomDetailsScreenDmDetails.png b/UITests/Sources/__Snapshots__/Application/en-GB-iPad-9th-generation.roomDetailsScreenDmDetails.png index 12593ca0f..546632056 100644 --- a/UITests/Sources/__Snapshots__/Application/en-GB-iPad-9th-generation.roomDetailsScreenDmDetails.png +++ b/UITests/Sources/__Snapshots__/Application/en-GB-iPad-9th-generation.roomDetailsScreenDmDetails.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ccb8342762f048022b0cb9b2100d235e120e56e485a7564c0bd572a807398bf2 -size 138647 +oid sha256:fde6a2bcb7affaca4ac29a02eab4cc1d0c3cde194e9651b8ecfb328017889b29 +size 147446 diff --git a/UITests/Sources/__Snapshots__/Application/en-GB-iPad-9th-generation.roomDetailsScreenWithEmptyTopic.png b/UITests/Sources/__Snapshots__/Application/en-GB-iPad-9th-generation.roomDetailsScreenWithEmptyTopic.png index cb9841c5a..9c741f1ea 100644 --- a/UITests/Sources/__Snapshots__/Application/en-GB-iPad-9th-generation.roomDetailsScreenWithEmptyTopic.png +++ b/UITests/Sources/__Snapshots__/Application/en-GB-iPad-9th-generation.roomDetailsScreenWithEmptyTopic.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1c83c28c9e8ee2196c5874fe958f1003aae29156afac721478578dc372706d48 -size 140846 +oid sha256:82755efa8743ce3a1f215b78bd4f5300c4f04dc792e6b8b7eba11d3892296242 +size 147877 diff --git a/UITests/Sources/__Snapshots__/Application/en-GB-iPad-9th-generation.roomDetailsScreenWithInvite.png b/UITests/Sources/__Snapshots__/Application/en-GB-iPad-9th-generation.roomDetailsScreenWithInvite.png index 33ae9a715..cfe6a5b05 100644 --- a/UITests/Sources/__Snapshots__/Application/en-GB-iPad-9th-generation.roomDetailsScreenWithInvite.png +++ b/UITests/Sources/__Snapshots__/Application/en-GB-iPad-9th-generation.roomDetailsScreenWithInvite.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:066a49f7d5f1e8fd46a3f35c403bd1b8257e5b30ad6c3af15ea666a783e1f399 -size 113268 +oid sha256:7cfec1d34aae82eb3c274d61277ef0442b1d55a7882158fc85b7821f06a58f72 +size 120357 diff --git a/UITests/Sources/__Snapshots__/Application/en-GB-iPad-9th-generation.roomDetailsScreenWithRoomAvatar.png b/UITests/Sources/__Snapshots__/Application/en-GB-iPad-9th-generation.roomDetailsScreenWithRoomAvatar.png index a8ebcaabc..0b8209571 100644 --- a/UITests/Sources/__Snapshots__/Application/en-GB-iPad-9th-generation.roomDetailsScreenWithRoomAvatar.png +++ b/UITests/Sources/__Snapshots__/Application/en-GB-iPad-9th-generation.roomDetailsScreenWithRoomAvatar.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:337b7463033f2b86866f880461402139586b960333b6f0e628b57eb3b32a0454 -size 145428 +oid sha256:514df171e80caa49231f04d9dce0d592f35504717bf29a7c9494780a2ff16dab +size 152121 diff --git a/UITests/Sources/__Snapshots__/Application/en-GB-iPhone-14.roomDetailsScreen.png b/UITests/Sources/__Snapshots__/Application/en-GB-iPhone-14.roomDetailsScreen.png index d928df507..f338ad952 100644 --- a/UITests/Sources/__Snapshots__/Application/en-GB-iPhone-14.roomDetailsScreen.png +++ b/UITests/Sources/__Snapshots__/Application/en-GB-iPhone-14.roomDetailsScreen.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:46d3807de58b096fe2a08dad9b6ee6ee4b67d9d7749332d7feceee0226d01d2c -size 134499 +oid sha256:fc5863a9f7cd340276d7db3d9f7d0d6e0e05bee9105e49a8ffa708770d57d5f4 +size 145363 diff --git a/UITests/Sources/__Snapshots__/Application/en-GB-iPhone-14.roomDetailsScreenDmDetails.png b/UITests/Sources/__Snapshots__/Application/en-GB-iPhone-14.roomDetailsScreenDmDetails.png index 9c865795d..a0986ac19 100644 --- a/UITests/Sources/__Snapshots__/Application/en-GB-iPhone-14.roomDetailsScreenDmDetails.png +++ b/UITests/Sources/__Snapshots__/Application/en-GB-iPhone-14.roomDetailsScreenDmDetails.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1ff99b080b22b3c09001fc3fc835e3b41c877f5e7f2cd6cfe26ef2f7c01a54c1 -size 176256 +oid sha256:7338da9308a75c605754f57484ba63633cfb3a72fbf15137175a1b78443830a6 +size 185001 diff --git a/UITests/Sources/__Snapshots__/Application/en-GB-iPhone-14.roomDetailsScreenWithEmptyTopic.png b/UITests/Sources/__Snapshots__/Application/en-GB-iPhone-14.roomDetailsScreenWithEmptyTopic.png index 915b6a66f..2229ea00f 100644 --- a/UITests/Sources/__Snapshots__/Application/en-GB-iPhone-14.roomDetailsScreenWithEmptyTopic.png +++ b/UITests/Sources/__Snapshots__/Application/en-GB-iPhone-14.roomDetailsScreenWithEmptyTopic.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9988534198d133d1f9e020e6af5628259bea9c6fdda64ac5b168230dc0a4621e -size 176611 +oid sha256:fe0445f069162f6790004b4d580f2cdd5ecc22c5d3a39cea9cb088de37058b0a +size 164478 diff --git a/UITests/Sources/__Snapshots__/Application/en-GB-iPhone-14.roomDetailsScreenWithInvite.png b/UITests/Sources/__Snapshots__/Application/en-GB-iPhone-14.roomDetailsScreenWithInvite.png index aac65412a..9de97aa09 100644 --- a/UITests/Sources/__Snapshots__/Application/en-GB-iPhone-14.roomDetailsScreenWithInvite.png +++ b/UITests/Sources/__Snapshots__/Application/en-GB-iPhone-14.roomDetailsScreenWithInvite.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6dd38abeb1ac142eae16fd258c9a346867f11f4075f2864e5815be30ddfcb9c6 -size 141613 +oid sha256:5baba19d2f8690464d4a99d070d135a33be6a2f098a54e01b98191bdd2aa7817 +size 146553 diff --git a/UITests/Sources/__Snapshots__/Application/en-GB-iPhone-14.roomDetailsScreenWithRoomAvatar.png b/UITests/Sources/__Snapshots__/Application/en-GB-iPhone-14.roomDetailsScreenWithRoomAvatar.png index 9d26d5265..c55d6a6a7 100644 --- a/UITests/Sources/__Snapshots__/Application/en-GB-iPhone-14.roomDetailsScreenWithRoomAvatar.png +++ b/UITests/Sources/__Snapshots__/Application/en-GB-iPhone-14.roomDetailsScreenWithRoomAvatar.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2a99249f04ea968b762cf14ff335f048eb7d91374c01761d8262c526f858431e -size 194812 +oid sha256:1017a6e0c07e16ad547be7c5ab8d05fbf614e3d94a05c54e266b2e544af0c624 +size 190264 diff --git a/UITests/Sources/__Snapshots__/Application/pseudo-iPad-9th-generation.roomDetailsScreen.png b/UITests/Sources/__Snapshots__/Application/pseudo-iPad-9th-generation.roomDetailsScreen.png index 28a94d314..664044d04 100644 --- a/UITests/Sources/__Snapshots__/Application/pseudo-iPad-9th-generation.roomDetailsScreen.png +++ b/UITests/Sources/__Snapshots__/Application/pseudo-iPad-9th-generation.roomDetailsScreen.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3288dfb3ed775665e37c214c4f2d2033e3174f22f41006f5fe0d1878a60866c1 -size 123312 +oid sha256:3804ce702c420b6086e5220d3c2e1ac53e8006d42b93b86af7eb6cb15701ca8d +size 131020 diff --git a/UITests/Sources/__Snapshots__/Application/pseudo-iPad-9th-generation.roomDetailsScreenDmDetails.png b/UITests/Sources/__Snapshots__/Application/pseudo-iPad-9th-generation.roomDetailsScreenDmDetails.png index 629e530cd..204f50d62 100644 --- a/UITests/Sources/__Snapshots__/Application/pseudo-iPad-9th-generation.roomDetailsScreenDmDetails.png +++ b/UITests/Sources/__Snapshots__/Application/pseudo-iPad-9th-generation.roomDetailsScreenDmDetails.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:47e87c18eb21430919e24ebc8307531e479e03fefffc001e45623739ea9ec62f -size 154961 +oid sha256:3e0ebc8183bfd11643aa2cc1d02e5d31d87f4da13ba81787c209cde531b8af04 +size 163638 diff --git a/UITests/Sources/__Snapshots__/Application/pseudo-iPad-9th-generation.roomDetailsScreenWithEmptyTopic.png b/UITests/Sources/__Snapshots__/Application/pseudo-iPad-9th-generation.roomDetailsScreenWithEmptyTopic.png index da7c29893..69d4c946d 100644 --- a/UITests/Sources/__Snapshots__/Application/pseudo-iPad-9th-generation.roomDetailsScreenWithEmptyTopic.png +++ b/UITests/Sources/__Snapshots__/Application/pseudo-iPad-9th-generation.roomDetailsScreenWithEmptyTopic.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:be36151a47830413040624f7d0922bd389321e11387e72c7581f691b3ea37b94 -size 156406 +oid sha256:0a4f869249c23dac0ea7a8df6e5bf620a1b68e9d6c45395fd4c268c044d11212 +size 164896 diff --git a/UITests/Sources/__Snapshots__/Application/pseudo-iPad-9th-generation.roomDetailsScreenWithInvite.png b/UITests/Sources/__Snapshots__/Application/pseudo-iPad-9th-generation.roomDetailsScreenWithInvite.png index beedbdf6b..084954854 100644 --- a/UITests/Sources/__Snapshots__/Application/pseudo-iPad-9th-generation.roomDetailsScreenWithInvite.png +++ b/UITests/Sources/__Snapshots__/Application/pseudo-iPad-9th-generation.roomDetailsScreenWithInvite.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:40e4ca832c774e501232f9d4a5dfaceae34d72d3a8f4a0647ff26afa73f5552e -size 129593 +oid sha256:d2c5cabe8eed9c5775f56948c2285f26985afb79a20e20232b7457ed23b29939 +size 136672 diff --git a/UITests/Sources/__Snapshots__/Application/pseudo-iPad-9th-generation.roomDetailsScreenWithRoomAvatar.png b/UITests/Sources/__Snapshots__/Application/pseudo-iPad-9th-generation.roomDetailsScreenWithRoomAvatar.png index 4fbec4371..ddcd659ac 100644 --- a/UITests/Sources/__Snapshots__/Application/pseudo-iPad-9th-generation.roomDetailsScreenWithRoomAvatar.png +++ b/UITests/Sources/__Snapshots__/Application/pseudo-iPad-9th-generation.roomDetailsScreenWithRoomAvatar.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:46290c09fa96860d002308e7fdc80dd9840c3ed12567489343ed568e1d11c55c -size 160957 +oid sha256:604985dc95f9f9744c3905719097e02cf6ee34dbc92f64af5d5e8c20cc2de0c1 +size 167214 diff --git a/UITests/Sources/__Snapshots__/Application/pseudo-iPhone-14.roomDetailsScreen.png b/UITests/Sources/__Snapshots__/Application/pseudo-iPhone-14.roomDetailsScreen.png index d278d6726..c7eb21c0b 100644 --- a/UITests/Sources/__Snapshots__/Application/pseudo-iPhone-14.roomDetailsScreen.png +++ b/UITests/Sources/__Snapshots__/Application/pseudo-iPhone-14.roomDetailsScreen.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0a6eec1fb4203afc950a9d33860e5a534d15327acf91d0caf4e500ca5a26999a -size 164960 +oid sha256:fcc306c1c49dec12330113c13bffd9798c4c7f9d81f687a8951d1ad38ddb565e +size 174444 diff --git a/UITests/Sources/__Snapshots__/Application/pseudo-iPhone-14.roomDetailsScreenDmDetails.png b/UITests/Sources/__Snapshots__/Application/pseudo-iPhone-14.roomDetailsScreenDmDetails.png index 46b05bf6e..a2eef33ee 100644 --- a/UITests/Sources/__Snapshots__/Application/pseudo-iPhone-14.roomDetailsScreenDmDetails.png +++ b/UITests/Sources/__Snapshots__/Application/pseudo-iPhone-14.roomDetailsScreenDmDetails.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ede47654000517fbf67ef6085f4b9c9574b50a73723925690a868dfad1c4684a -size 207805 +oid sha256:228dad18f45f4cac88e6a966d3ff8bca9464331286daa747b00c490a98a95119 +size 195223 diff --git a/UITests/Sources/__Snapshots__/Application/pseudo-iPhone-14.roomDetailsScreenWithEmptyTopic.png b/UITests/Sources/__Snapshots__/Application/pseudo-iPhone-14.roomDetailsScreenWithEmptyTopic.png index ef1dcf98c..f9c024b72 100644 --- a/UITests/Sources/__Snapshots__/Application/pseudo-iPhone-14.roomDetailsScreenWithEmptyTopic.png +++ b/UITests/Sources/__Snapshots__/Application/pseudo-iPhone-14.roomDetailsScreenWithEmptyTopic.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0ef967694784f25e8e3614498d8ada07569910917432815523e34a9a4f79f301 -size 178881 +oid sha256:20da96fd85689241026f81d279e34722ca3ad145833ece7616de10ecf7ad91c1 +size 176544 diff --git a/UITests/Sources/__Snapshots__/Application/pseudo-iPhone-14.roomDetailsScreenWithInvite.png b/UITests/Sources/__Snapshots__/Application/pseudo-iPhone-14.roomDetailsScreenWithInvite.png index 65def3856..6cb7c5bef 100644 --- a/UITests/Sources/__Snapshots__/Application/pseudo-iPhone-14.roomDetailsScreenWithInvite.png +++ b/UITests/Sources/__Snapshots__/Application/pseudo-iPhone-14.roomDetailsScreenWithInvite.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8d7232d8165976ef5cf09744c2b884c0f05a58eee69a345ccf515f27c578edd6 -size 170738 +oid sha256:6070b52b32d7578dd532c2db11e8e26344bfa632293f73ffcb08d15e33cd3303 +size 171361 diff --git a/UITests/Sources/__Snapshots__/Application/pseudo-iPhone-14.roomDetailsScreenWithRoomAvatar.png b/UITests/Sources/__Snapshots__/Application/pseudo-iPhone-14.roomDetailsScreenWithRoomAvatar.png index 6181e7fbb..f3daf3ae2 100644 --- a/UITests/Sources/__Snapshots__/Application/pseudo-iPhone-14.roomDetailsScreenWithRoomAvatar.png +++ b/UITests/Sources/__Snapshots__/Application/pseudo-iPhone-14.roomDetailsScreenWithRoomAvatar.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e75114908cf9e7049ceafeda01d5c69eb48a54bef628245a5eecd805e00e8026 -size 201023 +oid sha256:5400964f428e7625024743f6a06278ee5ef894c69ea12fb8927f88f8baecb68a +size 187116 diff --git a/UnitTests/Sources/HomeScreenRoomTests.swift b/UnitTests/Sources/HomeScreenRoomTests.swift index 5eedcfbcf..c88ad6143 100644 --- a/UnitTests/Sources/HomeScreenRoomTests.swift +++ b/UnitTests/Sources/HomeScreenRoomTests.swift @@ -36,14 +36,15 @@ class HomeScreenRoomTests: XCTestCase { avatarURL: nil, lastMessage: nil, lastMessageFormattedTimestamp: nil, - isMarkedUnread: isMarkedUnread, unreadMessagesCount: unreadMessagesCount, unreadMentionsCount: unreadMentionsCount, unreadNotificationsCount: unreadNotificationsCount, notificationMode: notificationMode, canonicalAlias: nil, inviter: nil, - hasOngoingCall: hasOngoingCall) + hasOngoingCall: hasOngoingCall, + isMarkedUnread: isMarkedUnread, + isFavourite: false) } func testNoBadge() { diff --git a/UnitTests/Sources/HomeScreenViewModelTests.swift b/UnitTests/Sources/HomeScreenViewModelTests.swift index b729bab8c..6adfca1ab 100644 --- a/UnitTests/Sources/HomeScreenViewModelTests.swift +++ b/UnitTests/Sources/HomeScreenViewModelTests.swift @@ -35,8 +35,9 @@ class HomeScreenViewModelTests: XCTestCase { viewModel = HomeScreenViewModel(userSession: MockUserSession(clientProxy: clientProxy, mediaProvider: MockMediaProvider(), voiceMessageMediaManager: VoiceMessageMediaManagerMock()), - selectedRoomPublisher: CurrentValueSubject(nil).asCurrentValuePublisher(), + analyticsService: ServiceLocator.shared.analytics, appSettings: ServiceLocator.shared.settings, + selectedRoomPublisher: CurrentValueSubject(nil).asCurrentValuePublisher(), userIndicatorController: ServiceLocator.shared.userIndicatorController) } diff --git a/UnitTests/Sources/LoggingTests.swift b/UnitTests/Sources/LoggingTests.swift index bb53b19e2..c8037797a 100644 --- a/UnitTests/Sources/LoggingTests.swift +++ b/UnitTests/Sources/LoggingTests.swift @@ -229,14 +229,15 @@ class LoggingTests: XCTestCase { avatarURL: nil, lastMessage: AttributedString(lastMessage), lastMessageFormattedTimestamp: "Now", - isMarkedUnread: false, unreadMessagesCount: 0, unreadMentionsCount: 0, unreadNotificationsCount: 0, notificationMode: nil, canonicalAlias: nil, inviter: nil, - hasOngoingCall: false) + hasOngoingCall: false, + isMarkedUnread: false, + isFavourite: false) // When logging that value XCTAssert(MXLogger.logFiles.isEmpty) diff --git a/UnitTests/Sources/RoomDetailsViewModelTests.swift b/UnitTests/Sources/RoomDetailsViewModelTests.swift index d319d0cee..2536fbbb4 100644 --- a/UnitTests/Sources/RoomDetailsViewModelTests.swift +++ b/UnitTests/Sources/RoomDetailsViewModelTests.swift @@ -36,6 +36,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase { viewModel = RoomDetailsScreenViewModel(accountUserID: "@owner:somewhere.com", roomProxy: roomProxyMock, mediaProvider: MockMediaProvider(), + analyticsService: ServiceLocator.shared.analytics, userIndicatorController: ServiceLocator.shared.userIndicatorController, notificationSettingsProxy: notificationSettingsProxyMock, attributedStringBuilder: AttributedStringBuilder(permalinkBaseURL: ServiceLocator.shared.settings.permalinkBaseURL, @@ -50,6 +51,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase { viewModel = RoomDetailsScreenViewModel(accountUserID: "@owner:somewhere.com", roomProxy: roomProxyMock, mediaProvider: MockMediaProvider(), + analyticsService: ServiceLocator.shared.analytics, userIndicatorController: ServiceLocator.shared.userIndicatorController, notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()), attributedStringBuilder: AttributedStringBuilder(permalinkBaseURL: ServiceLocator.shared.settings.permalinkBaseURL, @@ -71,6 +73,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase { viewModel = RoomDetailsScreenViewModel(accountUserID: "@owner:somewhere.com", roomProxy: roomProxyMock, mediaProvider: MockMediaProvider(), + analyticsService: ServiceLocator.shared.analytics, userIndicatorController: ServiceLocator.shared.userIndicatorController, notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()), attributedStringBuilder: AttributedStringBuilder(permalinkBaseURL: ServiceLocator.shared.settings.permalinkBaseURL, @@ -93,6 +96,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase { viewModel = RoomDetailsScreenViewModel(accountUserID: "@owner:somewhere.com", roomProxy: roomProxyMock, mediaProvider: MockMediaProvider(), + analyticsService: ServiceLocator.shared.analytics, userIndicatorController: ServiceLocator.shared.userIndicatorController, notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()), attributedStringBuilder: AttributedStringBuilder(permalinkBaseURL: ServiceLocator.shared.settings.permalinkBaseURL, @@ -145,6 +149,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase { viewModel = RoomDetailsScreenViewModel(accountUserID: "@owner:somewhere.com", roomProxy: roomProxyMock, mediaProvider: MockMediaProvider(), + analyticsService: ServiceLocator.shared.analytics, userIndicatorController: ServiceLocator.shared.userIndicatorController, notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()), attributedStringBuilder: AttributedStringBuilder(permalinkBaseURL: ServiceLocator.shared.settings.permalinkBaseURL, @@ -171,6 +176,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase { viewModel = RoomDetailsScreenViewModel(accountUserID: "@owner:somewhere.com", roomProxy: roomProxyMock, mediaProvider: MockMediaProvider(), + analyticsService: ServiceLocator.shared.analytics, userIndicatorController: ServiceLocator.shared.userIndicatorController, notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()), attributedStringBuilder: AttributedStringBuilder(permalinkBaseURL: ServiceLocator.shared.settings.permalinkBaseURL, @@ -206,6 +212,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase { viewModel = RoomDetailsScreenViewModel(accountUserID: "@owner:somewhere.com", roomProxy: roomProxyMock, mediaProvider: MockMediaProvider(), + analyticsService: ServiceLocator.shared.analytics, userIndicatorController: ServiceLocator.shared.userIndicatorController, notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()), attributedStringBuilder: AttributedStringBuilder(permalinkBaseURL: ServiceLocator.shared.settings.permalinkBaseURL, @@ -242,6 +249,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase { viewModel = RoomDetailsScreenViewModel(accountUserID: "@owner:somewhere.com", roomProxy: roomProxyMock, mediaProvider: MockMediaProvider(), + analyticsService: ServiceLocator.shared.analytics, userIndicatorController: ServiceLocator.shared.userIndicatorController, notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()), attributedStringBuilder: AttributedStringBuilder(permalinkBaseURL: ServiceLocator.shared.settings.permalinkBaseURL, @@ -277,6 +285,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase { viewModel = RoomDetailsScreenViewModel(accountUserID: "@owner:somewhere.com", roomProxy: roomProxyMock, mediaProvider: MockMediaProvider(), + analyticsService: ServiceLocator.shared.analytics, userIndicatorController: ServiceLocator.shared.userIndicatorController, notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()), attributedStringBuilder: AttributedStringBuilder(permalinkBaseURL: ServiceLocator.shared.settings.permalinkBaseURL, @@ -311,6 +320,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase { viewModel = RoomDetailsScreenViewModel(accountUserID: "@owner:somewhere.com", roomProxy: roomProxyMock, mediaProvider: MockMediaProvider(), + analyticsService: ServiceLocator.shared.analytics, userIndicatorController: ServiceLocator.shared.userIndicatorController, notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()), attributedStringBuilder: AttributedStringBuilder(permalinkBaseURL: ServiceLocator.shared.settings.permalinkBaseURL, @@ -327,6 +337,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase { viewModel = RoomDetailsScreenViewModel(accountUserID: "@owner:somewhere.com", roomProxy: roomProxyMock, mediaProvider: MockMediaProvider(), + analyticsService: ServiceLocator.shared.analytics, userIndicatorController: ServiceLocator.shared.userIndicatorController, notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()), attributedStringBuilder: AttributedStringBuilder(permalinkBaseURL: ServiceLocator.shared.settings.permalinkBaseURL, @@ -360,6 +371,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase { viewModel = RoomDetailsScreenViewModel(accountUserID: "@owner:somewhere.com", roomProxy: roomProxyMock, mediaProvider: MockMediaProvider(), + analyticsService: ServiceLocator.shared.analytics, userIndicatorController: ServiceLocator.shared.userIndicatorController, notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()), attributedStringBuilder: AttributedStringBuilder(permalinkBaseURL: ServiceLocator.shared.settings.permalinkBaseURL, @@ -380,6 +392,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase { viewModel = RoomDetailsScreenViewModel(accountUserID: "@owner:somewhere.com", roomProxy: roomProxyMock, mediaProvider: MockMediaProvider(), + analyticsService: ServiceLocator.shared.analytics, userIndicatorController: ServiceLocator.shared.userIndicatorController, notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()), attributedStringBuilder: AttributedStringBuilder(permalinkBaseURL: ServiceLocator.shared.settings.permalinkBaseURL, @@ -400,6 +413,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase { viewModel = RoomDetailsScreenViewModel(accountUserID: "@owner:somewhere.com", roomProxy: roomProxyMock, mediaProvider: MockMediaProvider(), + analyticsService: ServiceLocator.shared.analytics, userIndicatorController: ServiceLocator.shared.userIndicatorController, notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()), attributedStringBuilder: AttributedStringBuilder(permalinkBaseURL: ServiceLocator.shared.settings.permalinkBaseURL, @@ -420,6 +434,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase { viewModel = RoomDetailsScreenViewModel(accountUserID: "@owner:somewhere.com", roomProxy: roomProxyMock, mediaProvider: MockMediaProvider(), + analyticsService: ServiceLocator.shared.analytics, userIndicatorController: ServiceLocator.shared.userIndicatorController, notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()), attributedStringBuilder: AttributedStringBuilder(permalinkBaseURL: ServiceLocator.shared.settings.permalinkBaseURL, @@ -439,6 +454,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase { viewModel = RoomDetailsScreenViewModel(accountUserID: "@owner:somewhere.com", roomProxy: roomProxyMock, mediaProvider: MockMediaProvider(), + analyticsService: ServiceLocator.shared.analytics, userIndicatorController: ServiceLocator.shared.userIndicatorController, notificationSettingsProxy: NotificationSettingsProxyMock(with: NotificationSettingsProxyMockConfiguration()), attributedStringBuilder: AttributedStringBuilder(permalinkBaseURL: ServiceLocator.shared.settings.permalinkBaseURL, @@ -456,6 +472,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase { viewModel = RoomDetailsScreenViewModel(accountUserID: "@owner:somewhere.com", roomProxy: roomProxyMock, mediaProvider: MockMediaProvider(), + analyticsService: ServiceLocator.shared.analytics, userIndicatorController: ServiceLocator.shared.userIndicatorController, notificationSettingsProxy: notificationSettingsProxyMock, attributedStringBuilder: AttributedStringBuilder(permalinkBaseURL: ServiceLocator.shared.settings.permalinkBaseURL, diff --git a/UnitTests/__Snapshots__/PreviewTests/test_roomDetailsScreen.DM-Room.png b/UnitTests/__Snapshots__/PreviewTests/test_roomDetailsScreen.DM-Room.png index f9a010498..068cea1df 100644 --- a/UnitTests/__Snapshots__/PreviewTests/test_roomDetailsScreen.DM-Room.png +++ b/UnitTests/__Snapshots__/PreviewTests/test_roomDetailsScreen.DM-Room.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:68403794d5e16a6292920c5f0d988644a846766190832b587281f204c1720126 -size 166741 +oid sha256:2e7e980b8146ee25a482af352b9e0c2fdcddc002e0f15dfc7a4c5171e2df2431 +size 171771 diff --git a/UnitTests/__Snapshots__/PreviewTests/test_roomDetailsScreen.Generic-Room.png b/UnitTests/__Snapshots__/PreviewTests/test_roomDetailsScreen.Generic-Room.png index 3e43cd503..c15a5054c 100644 --- a/UnitTests/__Snapshots__/PreviewTests/test_roomDetailsScreen.Generic-Room.png +++ b/UnitTests/__Snapshots__/PreviewTests/test_roomDetailsScreen.Generic-Room.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f80de7b2596c4a0ff78ccd1aaef6f362fb37556b10bd77e02483570d11ee6599 -size 171882 +oid sha256:179d26714cf99868d2807d50a5ef8b0d512fd00893fcd3079e82ddd9c4d597c1 +size 157846 diff --git a/UnitTests/__Snapshots__/PreviewTests/test_roomDetailsScreen.Simple-Room.png b/UnitTests/__Snapshots__/PreviewTests/test_roomDetailsScreen.Simple-Room.png index 841a401a8..b95f0214c 100644 --- a/UnitTests/__Snapshots__/PreviewTests/test_roomDetailsScreen.Simple-Room.png +++ b/UnitTests/__Snapshots__/PreviewTests/test_roomDetailsScreen.Simple-Room.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2888c0ad77204a072df2e6cb01eb3a77ed6d110516d2ba5d63407adea603d2fd -size 128095 +oid sha256:46cc244fabd213bc6fdeebfa592002011632b8cc7b3df616607ff7d67f79b9ce +size 139500 diff --git a/changelog.d/2320.wip b/changelog.d/2320.wip new file mode 100644 index 000000000..7c550ff1c --- /dev/null +++ b/changelog.d/2320.wip @@ -0,0 +1 @@ +Implement support for (un)marking rooms as favourite from the room list and room detail screens \ No newline at end of file diff --git a/project.yml b/project.yml index f01d51cb4..0310ef065 100644 --- a/project.yml +++ b/project.yml @@ -55,8 +55,7 @@ packages: # path: ../compound-ios AnalyticsEvents: url: https://github.com/matrix-org/matrix-analytics-events - # minorVersion: 0.9.0 - revision: ad2b2d2b221bab89bf6443aafb925d52e30f4f6d + minorVersion: 0.11.0 Emojibase: url: https://github.com/matrix-org/emojibase-bindings minorVersion: 1.0.0