From b2afa048328b8e774ad80c2666b8d3a55a912105 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Thu, 6 Jun 2024 15:57:44 +0300 Subject: [PATCH] Cleanup dead code after Periphery run --- .../AppLockSetupFlowCoordinator.swift | 3 +- .../RoomFlowCoordinator.swift | 3 +- .../UserSessionFlowCoordinator.swift | 2 - .../Mocks/Generated/GeneratedMocks.swift | 69 ------------------- ...ssionVerificationControllerProxyMock.swift | 1 - ElementX/Sources/Mocks/UserSessionMock.swift | 1 - .../Other/AccessibilityIdentifiers.swift | 5 -- .../AVMetadataMachineReadableCodeObject.swift | 9 --- ...ppLockSetupSettingsScreenCoordinator.swift | 2 - .../AuthenticationStartScreenViewModel.swift | 2 - .../HomeScreen/HomeScreenCoordinator.swift | 2 - .../InviteUsersScreenViewModel.swift | 2 - .../JoinRoomScreenCoordinator.swift | 3 - .../View/MediaUploadPreviewScreen.swift | 4 +- .../QRCodeLoginScreenModels.swift | 9 --- .../View/QRCodeScannerView.swift | 1 - .../RoomDirectorySearchScreenViewModel.swift | 2 - .../RoomPollsHistoryScreenCoordinator.swift | 1 - .../ComposerToolbarViewModel.swift | 3 - .../View/ComposerToolbar.swift | 5 -- .../View/RoomAttachmentPicker.swift | 1 - .../RoomScreen/RoomScreenCoordinator.swift | 4 +- .../RoomScreen/RoomScreenViewModel.swift | 8 +-- .../ReadReceiptsSummaryView.swift | 3 +- .../Screens/RoomScreen/View/RoomScreen.swift | 3 +- .../TimelineReadReceiptsView.swift | 3 +- .../HighlightedTimelineItemModifier.swift | 3 +- .../View/Timeline/TimelineView.swift | 3 +- .../DeveloperOptionsScreenModels.swift | 1 - ...NotificationSettingsEditScreenModels.swift | 1 - ...ificationSettingsEditScreenViewModel.swift | 3 +- .../SettingsScreen/View/SettingsScreen.swift | 16 +---- .../Sources/Services/Client/ClientProxy.swift | 3 - .../Services/Session/UserSession.swift | 2 - .../SessionVerificationControllerProxy.swift | 11 +-- ...nVerificationControllerProxyProtocol.swift | 3 - .../RoomTimelineController.swift | 2 - .../Services/Timeline/TimelineProxy.swift | 2 - .../Timeline/TimelineProxyProtocol.swift | 2 - .../UserSession/UserSessionStore.swift | 1 - .../ComposerToolbarViewModelTests.swift | 2 - UnitTests/Sources/PillContextTests.swift | 9 +-- .../Sources/RoomScreenViewModelTests.swift | 9 +-- 43 files changed, 20 insertions(+), 204 deletions(-) diff --git a/ElementX/Sources/FlowCoordinators/AppLockSetupFlowCoordinator.swift b/ElementX/Sources/FlowCoordinators/AppLockSetupFlowCoordinator.swift index d43449b20..78bcbdd1f 100644 --- a/ElementX/Sources/FlowCoordinators/AppLockSetupFlowCoordinator.swift +++ b/ElementX/Sources/FlowCoordinators/AppLockSetupFlowCoordinator.swift @@ -251,8 +251,7 @@ class AppLockSetupFlowCoordinator: FlowCoordinatorProtocol { } private func showSettings() { - let coordinator = AppLockSetupSettingsScreenCoordinator(parameters: .init(isMandatory: appLockService.isMandatory, - appLockService: appLockService)) + let coordinator = AppLockSetupSettingsScreenCoordinator(parameters: .init(appLockService: appLockService)) coordinator.actions.sink { [weak self] action in guard let self else { return } switch action { diff --git a/ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift b/ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift index aa7a8501f..d8ca88776 100644 --- a/ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift +++ b/ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift @@ -1036,8 +1036,7 @@ class RoomFlowCoordinator: FlowCoordinatorProtocol { initialFocussedEventID: nil, timelineItemFactory: timelineItemFactory) - let parameters = RoomPollsHistoryScreenCoordinatorParameters(roomProxy: roomProxy, - pollInteractionHandler: PollInteractionHandler(analyticsService: analytics, roomProxy: roomProxy), + let parameters = RoomPollsHistoryScreenCoordinatorParameters(pollInteractionHandler: PollInteractionHandler(analyticsService: analytics, roomProxy: roomProxy), roomTimelineController: roomTimelineController) let coordinator = RoomPollsHistoryScreenCoordinator(parameters: parameters) coordinator.actions diff --git a/ElementX/Sources/FlowCoordinators/UserSessionFlowCoordinator.swift b/ElementX/Sources/FlowCoordinators/UserSessionFlowCoordinator.swift index 848e9c87d..8fceeae02 100644 --- a/ElementX/Sources/FlowCoordinators/UserSessionFlowCoordinator.swift +++ b/ElementX/Sources/FlowCoordinators/UserSessionFlowCoordinator.swift @@ -364,9 +364,7 @@ class UserSessionFlowCoordinator: FlowCoordinatorProtocol { private func presentHomeScreen() { let parameters = HomeScreenCoordinatorParameters(userSession: userSession, - attributedStringBuilder: AttributedStringBuilder(mentionBuilder: MentionBuilder()), bugReportService: bugReportService, - navigationStackCoordinator: detailNavigationStackCoordinator, selectedRoomPublisher: selectedRoomSubject.asCurrentValuePublisher()) let coordinator = HomeScreenCoordinator(parameters: parameters) diff --git a/ElementX/Sources/Mocks/Generated/GeneratedMocks.swift b/ElementX/Sources/Mocks/Generated/GeneratedMocks.swift index 4b9cb51da..e2e076c31 100644 --- a/ElementX/Sources/Mocks/Generated/GeneratedMocks.swift +++ b/ElementX/Sources/Mocks/Generated/GeneratedMocks.swift @@ -10710,70 +10710,6 @@ class SessionVerificationControllerProxyMock: SessionVerificationControllerProxy } var underlyingCallbacks: PassthroughSubject! - //MARK: - isVerified - - var isVerifiedUnderlyingCallsCount = 0 - var isVerifiedCallsCount: Int { - get { - if Thread.isMainThread { - return isVerifiedUnderlyingCallsCount - } else { - var returnValue: Int? = nil - DispatchQueue.main.sync { - returnValue = isVerifiedUnderlyingCallsCount - } - - return returnValue! - } - } - set { - if Thread.isMainThread { - isVerifiedUnderlyingCallsCount = newValue - } else { - DispatchQueue.main.sync { - isVerifiedUnderlyingCallsCount = newValue - } - } - } - } - var isVerifiedCalled: Bool { - return isVerifiedCallsCount > 0 - } - - var isVerifiedUnderlyingReturnValue: Result! - var isVerifiedReturnValue: Result! { - get { - if Thread.isMainThread { - return isVerifiedUnderlyingReturnValue - } else { - var returnValue: Result? = nil - DispatchQueue.main.sync { - returnValue = isVerifiedUnderlyingReturnValue - } - - return returnValue! - } - } - set { - if Thread.isMainThread { - isVerifiedUnderlyingReturnValue = newValue - } else { - DispatchQueue.main.sync { - isVerifiedUnderlyingReturnValue = newValue - } - } - } - } - var isVerifiedClosure: (() async -> Result)? - - func isVerified() async -> Result { - isVerifiedCallsCount += 1 - if let isVerifiedClosure = isVerifiedClosure { - return await isVerifiedClosure() - } else { - return isVerifiedReturnValue - } - } //MARK: - requestVerification var requestVerificationUnderlyingCallsCount = 0 @@ -11096,11 +11032,6 @@ class SessionVerificationControllerProxyMock: SessionVerificationControllerProxy } } class TimelineProxyMock: TimelineProxyProtocol { - var isLive: Bool { - get { return underlyingIsLive } - set(value) { underlyingIsLive = value } - } - var underlyingIsLive: Bool! var timelineProvider: RoomTimelineProviderProtocol { get { return underlyingTimelineProvider } set(value) { underlyingTimelineProvider = value } diff --git a/ElementX/Sources/Mocks/SessionVerificationControllerProxyMock.swift b/ElementX/Sources/Mocks/SessionVerificationControllerProxyMock.swift index 36aaba3cb..3af649d26 100644 --- a/ElementX/Sources/Mocks/SessionVerificationControllerProxyMock.swift +++ b/ElementX/Sources/Mocks/SessionVerificationControllerProxyMock.swift @@ -30,7 +30,6 @@ extension SessionVerificationControllerProxyMock { requestDelay: Duration = .seconds(1)) -> SessionVerificationControllerProxyMock { let mock = SessionVerificationControllerProxyMock() mock.underlyingCallbacks = callbacks - mock.isVerifiedReturnValue = .success(isVerified) mock.requestVerificationClosure = { [unowned mock] in Task.detached { diff --git a/ElementX/Sources/Mocks/UserSessionMock.swift b/ElementX/Sources/Mocks/UserSessionMock.swift index 824fb5617..8a291eec6 100644 --- a/ElementX/Sources/Mocks/UserSessionMock.swift +++ b/ElementX/Sources/Mocks/UserSessionMock.swift @@ -18,7 +18,6 @@ import Combine import Foundation struct UserSessionMockConfiguration { - var sessionVerificationController: SessionVerificationControllerProxyProtocol? let clientProxy: ClientProxyProtocol } diff --git a/ElementX/Sources/Other/AccessibilityIdentifiers.swift b/ElementX/Sources/Other/AccessibilityIdentifiers.swift index 8ff8a0302..f714ac91b 100644 --- a/ElementX/Sources/Other/AccessibilityIdentifiers.swift +++ b/ElementX/Sources/Other/AccessibilityIdentifiers.swift @@ -93,9 +93,7 @@ enum A11yIdentifiers { struct HomeScreen { let userAvatar = "home_screen-user_avatar" - let verificationBannerContinue = "home_screen-verification_continue" let recoveryKeyConfirmationBannerContinue = "home_screen-recovery_key_confirmation_continue" - let invites = "home_screen-invites" let startChat = "home_screen-start_chat" let roomNamePrefix = "home_screen-room_name" @@ -164,7 +162,6 @@ enum A11yIdentifiers { let avatar = "room_details-avatar" let dmAvatar = "room_details-dm_avatar" let people = "room_details-people" - let invite = "room_details-invite" let notifications = "room_details-notifications" let pollsHistory = "room_details-polls_history" let favourite = "room_details-favourite" @@ -200,8 +197,6 @@ enum A11yIdentifiers { let declineChallenge = "session_verification-decline_challenge" let emojiWrapper = "session_verification-emojis" let verificationComplete = "session_verification-verification_complete" - let close = "session_verification-close" - let enterRecoveryKey = "session_verification-enter_recovery_key" } struct SettingsScreen { diff --git a/ElementX/Sources/Other/Extensions/AVMetadataMachineReadableCodeObject.swift b/ElementX/Sources/Other/Extensions/AVMetadataMachineReadableCodeObject.swift index 969e479ba..770957f20 100644 --- a/ElementX/Sources/Other/Extensions/AVMetadataMachineReadableCodeObject.swift +++ b/ElementX/Sources/Other/Extensions/AVMetadataMachineReadableCodeObject.swift @@ -120,15 +120,6 @@ private extension Data { } return result } - - init(_ halves: [HalfByte]) { - var halves = halves - var result = [UInt8]() - while halves.count > 1 { - result.append(halves.takeUInt8()) - } - self.init(result) - } } private extension UInt8 { diff --git a/ElementX/Sources/Screens/AppLock/AppLockSetupSettingsScreen/AppLockSetupSettingsScreenCoordinator.swift b/ElementX/Sources/Screens/AppLock/AppLockSetupSettingsScreen/AppLockSetupSettingsScreenCoordinator.swift index df9b318e3..171067681 100644 --- a/ElementX/Sources/Screens/AppLock/AppLockSetupSettingsScreen/AppLockSetupSettingsScreenCoordinator.swift +++ b/ElementX/Sources/Screens/AppLock/AppLockSetupSettingsScreen/AppLockSetupSettingsScreenCoordinator.swift @@ -18,8 +18,6 @@ import Combine import SwiftUI struct AppLockSetupSettingsScreenCoordinatorParameters { - /// Whether App Lock is mandatory and can be disabled by the user. - let isMandatory: Bool let appLockService: AppLockServiceProtocol } diff --git a/ElementX/Sources/Screens/AuthenticationStartScreen/AuthenticationStartScreenViewModel.swift b/ElementX/Sources/Screens/AuthenticationStartScreen/AuthenticationStartScreenViewModel.swift index 48a414bcf..df24dbaa4 100644 --- a/ElementX/Sources/Screens/AuthenticationStartScreen/AuthenticationStartScreenViewModel.swift +++ b/ElementX/Sources/Screens/AuthenticationStartScreen/AuthenticationStartScreenViewModel.swift @@ -20,7 +20,6 @@ import SwiftUI typealias AuthenticationStartScreenViewModelType = StateStoreViewModel class AuthenticationStartScreenViewModel: AuthenticationStartScreenViewModelType, AuthenticationStartScreenViewModelProtocol { - private let appSettings: AppSettings private var actionsSubject: PassthroughSubject = .init() var actions: AnyPublisher { @@ -28,7 +27,6 @@ class AuthenticationStartScreenViewModel: AuthenticationStartScreenViewModelType } init(appSettings: AppSettings) { - self.appSettings = appSettings super.init(initialViewState: AuthenticationStartScreenViewState()) if !ProcessInfo.processInfo.isiOSAppOnMac { if appSettings.isDevelopmentBuild { diff --git a/ElementX/Sources/Screens/HomeScreen/HomeScreenCoordinator.swift b/ElementX/Sources/Screens/HomeScreen/HomeScreenCoordinator.swift index adfa41bd7..f5e6795aa 100644 --- a/ElementX/Sources/Screens/HomeScreen/HomeScreenCoordinator.swift +++ b/ElementX/Sources/Screens/HomeScreen/HomeScreenCoordinator.swift @@ -19,9 +19,7 @@ import SwiftUI struct HomeScreenCoordinatorParameters { let userSession: UserSessionProtocol - let attributedStringBuilder: AttributedStringBuilderProtocol let bugReportService: BugReportServiceProtocol - let navigationStackCoordinator: NavigationStackCoordinator let selectedRoomPublisher: CurrentValuePublisher } diff --git a/ElementX/Sources/Screens/InviteUsersScreen/InviteUsersScreenViewModel.swift b/ElementX/Sources/Screens/InviteUsersScreen/InviteUsersScreenViewModel.swift index 54fe30339..55f31122d 100644 --- a/ElementX/Sources/Screens/InviteUsersScreen/InviteUsersScreenViewModel.swift +++ b/ElementX/Sources/Screens/InviteUsersScreen/InviteUsersScreenViewModel.swift @@ -21,7 +21,6 @@ import SwiftUI typealias InviteUsersScreenViewModelType = StateStoreViewModel class InviteUsersScreenViewModel: InviteUsersScreenViewModelType, InviteUsersScreenViewModelProtocol { - private let clientProxy: ClientProxyProtocol private let roomType: InviteUsersScreenRoomType private let userDiscoveryService: UserDiscoveryServiceProtocol private let userIndicatorController: UserIndicatorControllerProtocol @@ -39,7 +38,6 @@ class InviteUsersScreenViewModel: InviteUsersScreenViewModelType, InviteUsersScr mediaProvider: MediaProviderProtocol, userDiscoveryService: UserDiscoveryServiceProtocol, userIndicatorController: UserIndicatorControllerProtocol) { - self.clientProxy = clientProxy self.roomType = roomType self.userDiscoveryService = userDiscoveryService self.userIndicatorController = userIndicatorController diff --git a/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenCoordinator.swift b/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenCoordinator.swift index e3ba955ce..a7dfb7cf7 100644 --- a/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenCoordinator.swift +++ b/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenCoordinator.swift @@ -31,7 +31,6 @@ enum JoinRoomScreenCoordinatorAction { } final class JoinRoomScreenCoordinator: CoordinatorProtocol { - private let parameters: JoinRoomScreenCoordinatorParameters private let viewModel: JoinRoomScreenViewModelProtocol private var cancellables = Set() @@ -42,8 +41,6 @@ final class JoinRoomScreenCoordinator: CoordinatorProtocol { } init(parameters: JoinRoomScreenCoordinatorParameters) { - self.parameters = parameters - viewModel = JoinRoomScreenViewModel(roomID: parameters.roomID, via: parameters.via, clientProxy: parameters.clientProxy, diff --git a/ElementX/Sources/Screens/MediaUploadPreviewScreen/View/MediaUploadPreviewScreen.swift b/ElementX/Sources/Screens/MediaUploadPreviewScreen/View/MediaUploadPreviewScreen.swift index ada145239..0120db1dc 100644 --- a/ElementX/Sources/Screens/MediaUploadPreviewScreen/View/MediaUploadPreviewScreen.swift +++ b/ElementX/Sources/Screens/MediaUploadPreviewScreen/View/MediaUploadPreviewScreen.swift @@ -42,8 +42,7 @@ struct MediaUploadPreviewScreen: View { .font(.compound.headingMD) .foregroundColor(.compound.textSecondary) } else { - PreviewView(context: context, - fileURL: context.viewState.url, + PreviewView(fileURL: context.viewState.url, title: context.viewState.title) } } @@ -65,7 +64,6 @@ struct MediaUploadPreviewScreen: View { } private struct PreviewView: UIViewControllerRepresentable { - let context: MediaUploadPreviewScreenViewModel.Context let fileURL: URL let title: String? diff --git a/ElementX/Sources/Screens/QRCodeLoginScreen/QRCodeLoginScreenModels.swift b/ElementX/Sources/Screens/QRCodeLoginScreen/QRCodeLoginScreenModels.swift index 2c06b9556..647299024 100644 --- a/ElementX/Sources/Screens/QRCodeLoginScreen/QRCodeLoginScreenModels.swift +++ b/ElementX/Sources/Screens/QRCodeLoginScreen/QRCodeLoginScreenModels.swift @@ -107,15 +107,6 @@ enum QRCodeLoginState: Equatable { } } - var isDisplayingCode: Bool { - switch self { - case .displayCode: - return true - default: - return false - } - } - var isScanning: Bool { switch self { case .scan(let state): diff --git a/ElementX/Sources/Screens/QRCodeLoginScreen/View/QRCodeScannerView.swift b/ElementX/Sources/Screens/QRCodeLoginScreen/View/QRCodeScannerView.swift index fd1113432..613403c59 100644 --- a/ElementX/Sources/Screens/QRCodeLoginScreen/View/QRCodeScannerView.swift +++ b/ElementX/Sources/Screens/QRCodeLoginScreen/View/QRCodeScannerView.swift @@ -66,7 +66,6 @@ struct QRCodeScannerView: UIViewControllerRepresentable { final class QRScannerController: UIViewController { private var captureSession = AVCaptureSession() private var videoPreviewLayer: AVCaptureVideoPreviewLayer? - private var qrCodeFrameView: UIView? weak var delegate: AVCaptureMetadataOutputObjectsDelegate? diff --git a/ElementX/Sources/Screens/RoomDirectorySearchScreen/RoomDirectorySearchScreenViewModel.swift b/ElementX/Sources/Screens/RoomDirectorySearchScreen/RoomDirectorySearchScreenViewModel.swift index a30713dc4..55ad1d3bc 100644 --- a/ElementX/Sources/Screens/RoomDirectorySearchScreen/RoomDirectorySearchScreenViewModel.swift +++ b/ElementX/Sources/Screens/RoomDirectorySearchScreen/RoomDirectorySearchScreenViewModel.swift @@ -20,7 +20,6 @@ import SwiftUI typealias RoomDirectorySearchScreenViewModelType = StateStoreViewModel class RoomDirectorySearchScreenViewModel: RoomDirectorySearchScreenViewModelType, RoomDirectorySearchScreenViewModelProtocol { - private let clientProxy: ClientProxyProtocol private let roomDirectorySearchProxy: RoomDirectorySearchProxyProtocol private let userIndicatorController: UserIndicatorControllerProtocol @@ -32,7 +31,6 @@ class RoomDirectorySearchScreenViewModel: RoomDirectorySearchScreenViewModelType init(clientProxy: ClientProxyProtocol, userIndicatorController: UserIndicatorControllerProtocol, imageProvider: ImageProviderProtocol) { - self.clientProxy = clientProxy roomDirectorySearchProxy = clientProxy.roomDirectorySearchProxy() self.userIndicatorController = userIndicatorController diff --git a/ElementX/Sources/Screens/RoomPollsHistoryScreen/RoomPollsHistoryScreenCoordinator.swift b/ElementX/Sources/Screens/RoomPollsHistoryScreen/RoomPollsHistoryScreenCoordinator.swift index 771a6ad95..89b9c71b7 100644 --- a/ElementX/Sources/Screens/RoomPollsHistoryScreen/RoomPollsHistoryScreenCoordinator.swift +++ b/ElementX/Sources/Screens/RoomPollsHistoryScreen/RoomPollsHistoryScreenCoordinator.swift @@ -18,7 +18,6 @@ import Combine import SwiftUI struct RoomPollsHistoryScreenCoordinatorParameters { - let roomProxy: RoomProxyProtocol let pollInteractionHandler: PollInteractionHandlerProtocol let roomTimelineController: RoomTimelineControllerProtocol } diff --git a/ElementX/Sources/Screens/RoomScreen/ComposerToolbar/ComposerToolbarViewModel.swift b/ElementX/Sources/Screens/RoomScreen/ComposerToolbar/ComposerToolbarViewModel.swift index be3c57ff4..df91d50b4 100644 --- a/ElementX/Sources/Screens/RoomScreen/ComposerToolbar/ComposerToolbarViewModel.swift +++ b/ElementX/Sources/Screens/RoomScreen/ComposerToolbar/ComposerToolbarViewModel.swift @@ -26,7 +26,6 @@ typealias ComposerToolbarViewModelType = StateStoreViewModel(false) init(client: ClientProtocol, - appSettings: AppSettings, networkMonitor: NetworkMonitorProtocol) async { self.client = client - self.appSettings = appSettings self.networkMonitor = networkMonitor clientQueue = .init(label: "ClientProxyQueue", attributes: .concurrent) diff --git a/ElementX/Sources/Services/Session/UserSession.swift b/ElementX/Sources/Services/Session/UserSession.swift index 5f416b865..881bd60e8 100644 --- a/ElementX/Sources/Services/Session/UserSession.swift +++ b/ElementX/Sources/Services/Session/UserSession.swift @@ -18,8 +18,6 @@ import Combine import Foundation class UserSession: UserSessionProtocol { - private let sessionVerificationStateSubject: CurrentValueSubject = .init(.unknown) - private var cancellables = Set() private var authErrorCancellable: AnyCancellable? diff --git a/ElementX/Sources/Services/SessionVerification/SessionVerificationControllerProxy.swift b/ElementX/Sources/Services/SessionVerification/SessionVerificationControllerProxy.swift index 07fc8f338..fa7f2ab4e 100644 --- a/ElementX/Sources/Services/SessionVerification/SessionVerificationControllerProxy.swift +++ b/ElementX/Sources/Services/SessionVerification/SessionVerificationControllerProxy.swift @@ -70,16 +70,7 @@ class SessionVerificationControllerProxy: SessionVerificationControllerProxyProt } let callbacks = PassthroughSubject() - - func isVerified() async -> Result { - do { - let result = try await sessionVerificationController.isVerified() - return .success(result) - } catch { - return .failure(.failedCheckingVerificationState) - } - } - + func requestVerification() async -> Result { sessionVerificationController.setDelegate(delegate: WeakSessionVerificationControllerProxy(proxy: self)) diff --git a/ElementX/Sources/Services/SessionVerification/SessionVerificationControllerProxyProtocol.swift b/ElementX/Sources/Services/SessionVerification/SessionVerificationControllerProxyProtocol.swift index 5d0b04078..a6a2f1269 100644 --- a/ElementX/Sources/Services/SessionVerification/SessionVerificationControllerProxyProtocol.swift +++ b/ElementX/Sources/Services/SessionVerification/SessionVerificationControllerProxyProtocol.swift @@ -18,7 +18,6 @@ import Combine import Foundation enum SessionVerificationControllerProxyError: Error { - case failedCheckingVerificationState case failedRequestingVerification case failedStartingSasVerification case failedApprovingVerification @@ -47,8 +46,6 @@ struct SessionVerificationEmoji: Hashable { // sourcery: AutoMockable protocol SessionVerificationControllerProxyProtocol { var callbacks: PassthroughSubject { get } - - func isVerified() async -> Result func requestVerification() async -> Result diff --git a/ElementX/Sources/Services/Timeline/TimelineController/RoomTimelineController.swift b/ElementX/Sources/Services/Timeline/TimelineController/RoomTimelineController.swift index 9322f61ea..5a1679702 100644 --- a/ElementX/Sources/Services/Timeline/TimelineController/RoomTimelineController.swift +++ b/ElementX/Sources/Services/Timeline/TimelineController/RoomTimelineController.swift @@ -26,8 +26,6 @@ class RoomTimelineController: RoomTimelineControllerProtocol { private let appSettings: AppSettings private let serialDispatchQueue: DispatchQueue - private var cancellables = Set() - let callbacks = PassthroughSubject() private var activeTimeline: TimelineProxyProtocol diff --git a/ElementX/Sources/Services/Timeline/TimelineProxy.swift b/ElementX/Sources/Services/Timeline/TimelineProxy.swift index 36d9c1ec4..00594d94e 100644 --- a/ElementX/Sources/Services/Timeline/TimelineProxy.swift +++ b/ElementX/Sources/Services/Timeline/TimelineProxy.swift @@ -21,8 +21,6 @@ import MatrixRustSDK final class TimelineProxy: TimelineProxyProtocol { private let timeline: Timeline - private let messageSendingDispatchQueue = DispatchQueue(label: "io.element.elementx.roomproxy.message_sending", qos: .userInitiated) - private var backPaginationStatusObservationToken: TaskHandle? private var roomTimelineObservationToken: TaskHandle? diff --git a/ElementX/Sources/Services/Timeline/TimelineProxyProtocol.swift b/ElementX/Sources/Services/Timeline/TimelineProxyProtocol.swift index dc3ab9ab5..0e4323f5b 100644 --- a/ElementX/Sources/Services/Timeline/TimelineProxyProtocol.swift +++ b/ElementX/Sources/Services/Timeline/TimelineProxyProtocol.swift @@ -28,8 +28,6 @@ enum TimelineProxyError: Error { // sourcery: AutoMockable protocol TimelineProxyProtocol { - var isLive: Bool { get } - var timelineProvider: RoomTimelineProviderProtocol { get } func subscribeForUpdates() async diff --git a/ElementX/Sources/Services/UserSession/UserSessionStore.swift b/ElementX/Sources/Services/UserSession/UserSessionStore.swift index b4519c1e0..7b873077e 100644 --- a/ElementX/Sources/Services/UserSession/UserSessionStore.swift +++ b/ElementX/Sources/Services/UserSession/UserSessionStore.swift @@ -148,7 +148,6 @@ class UserSessionStore: UserSessionStoreProtocol { private func setupProxyForClient(_ client: Client) async -> ClientProxyProtocol { await ClientProxy(client: client, - appSettings: ServiceLocator.shared.settings, networkMonitor: ServiceLocator.shared.networkMonitor) } diff --git a/UnitTests/Sources/ComposerToolbarViewModelTests.swift b/UnitTests/Sources/ComposerToolbarViewModelTests.swift index d35cf6075..039f30010 100644 --- a/UnitTests/Sources/ComposerToolbarViewModelTests.swift +++ b/UnitTests/Sources/ComposerToolbarViewModelTests.swift @@ -36,7 +36,6 @@ class ComposerToolbarViewModelTests: XCTestCase { viewModel = ComposerToolbarViewModel(wysiwygViewModel: wysiwygViewModel, completionSuggestionService: completionSuggestionServiceMock, mediaProvider: MockMediaProvider(), - appSettings: appSettings, mentionDisplayHelper: ComposerMentionDisplayHelper.mock, analyticsService: ServiceLocator.shared.analytics) @@ -113,7 +112,6 @@ class ComposerToolbarViewModelTests: XCTestCase { viewModel = ComposerToolbarViewModel(wysiwygViewModel: wysiwygViewModel, completionSuggestionService: mockCompletionSuggestionService, mediaProvider: MockMediaProvider(), - appSettings: ServiceLocator.shared.settings, mentionDisplayHelper: ComposerMentionDisplayHelper.mock, analyticsService: ServiceLocator.shared.analytics) diff --git a/UnitTests/Sources/PillContextTests.swift b/UnitTests/Sources/PillContextTests.swift index 9d5504df4..3ddbd4f78 100644 --- a/UnitTests/Sources/PillContextTests.swift +++ b/UnitTests/Sources/PillContextTests.swift @@ -34,8 +34,7 @@ class PillContextTests: XCTestCase { userIndicatorController: ServiceLocator.shared.userIndicatorController, appMediator: AppMediatorMock.default, appSettings: ServiceLocator.shared.settings, - analyticsService: ServiceLocator.shared.analytics, - notificationCenter: NotificationCenterMock()) + analyticsService: ServiceLocator.shared.analytics) let context = PillContext(roomContext: mock.context, data: PillTextAttachmentData(type: .user(userID: id), font: .preferredFont(forTextStyle: .body))) XCTAssertFalse(context.viewState.isOwnMention) @@ -63,8 +62,7 @@ class PillContextTests: XCTestCase { userIndicatorController: ServiceLocator.shared.userIndicatorController, appMediator: AppMediatorMock.default, appSettings: ServiceLocator.shared.settings, - analyticsService: ServiceLocator.shared.analytics, - notificationCenter: NotificationCenterMock()) + analyticsService: ServiceLocator.shared.analytics) let context = PillContext(roomContext: mock.context, data: PillTextAttachmentData(type: .user(userID: id), font: .preferredFont(forTextStyle: .body))) XCTAssertTrue(context.viewState.isOwnMention) @@ -85,8 +83,7 @@ class PillContextTests: XCTestCase { userIndicatorController: ServiceLocator.shared.userIndicatorController, appMediator: AppMediatorMock.default, appSettings: ServiceLocator.shared.settings, - analyticsService: ServiceLocator.shared.analytics, - notificationCenter: NotificationCenterMock()) + analyticsService: ServiceLocator.shared.analytics) let context = PillContext(roomContext: mock.context, data: PillTextAttachmentData(type: .allUsers, font: .preferredFont(forTextStyle: .body))) XCTAssertTrue(context.viewState.isOwnMention) diff --git a/UnitTests/Sources/RoomScreenViewModelTests.swift b/UnitTests/Sources/RoomScreenViewModelTests.swift index e554bc8f1..b547d928e 100644 --- a/UnitTests/Sources/RoomScreenViewModelTests.swift +++ b/UnitTests/Sources/RoomScreenViewModelTests.swift @@ -353,8 +353,7 @@ class RoomScreenViewModelTests: XCTestCase { userIndicatorController: userIndicatorControllerMock, appMediator: AppMediatorMock.default, appSettings: ServiceLocator.shared.settings, - analyticsService: ServiceLocator.shared.analytics, - notificationCenter: notificationCenter) + analyticsService: ServiceLocator.shared.analytics) return (viewModel, roomProxy, timelineProxy, timelineController, notificationCenter) } @@ -378,8 +377,7 @@ class RoomScreenViewModelTests: XCTestCase { userIndicatorController: userIndicatorControllerMock, appMediator: AppMediatorMock.default, appSettings: ServiceLocator.shared.settings, - analyticsService: ServiceLocator.shared.analytics, - notificationCenter: NotificationCenterMock()) + analyticsService: ServiceLocator.shared.analytics) let deferred = deferFulfillment(viewModel.context.$viewState) { value in value.bindings.readReceiptsSummaryInfo?.orderedReceipts == receipts @@ -403,8 +401,7 @@ class RoomScreenViewModelTests: XCTestCase { userIndicatorController: userIndicatorControllerMock, appMediator: AppMediatorMock.default, appSettings: ServiceLocator.shared.settings, - analyticsService: ServiceLocator.shared.analytics, - notificationCenter: NotificationCenterMock()) + analyticsService: ServiceLocator.shared.analytics) } }