diff --git a/ElementX.xcodeproj/project.pbxproj b/ElementX.xcodeproj/project.pbxproj index 0ec568b4c..625d32bd0 100644 --- a/ElementX.xcodeproj/project.pbxproj +++ b/ElementX.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 54; + objectVersion = 56; objects = { /* Begin PBXAggregateTarget section */ @@ -29,7 +29,6 @@ 02D8DF8EB7537EB4E9019DDB /* EventBasedTimelineItemProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 218AB05B4E3889731959C5F1 /* EventBasedTimelineItemProtocol.swift */; }; 02F4FAE40AF63A1941FD3BBA /* NotificationCenterProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 10B7F8EE25775DE2A305CBB5 /* NotificationCenterProtocol.swift */; }; 037006FB6DF1374F94E4058D /* Dictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFDCAC6CAAD65A2C24EA9C4B /* Dictionary.swift */; }; - 03D684A3AE85A23B3DA3B43F /* Image.swift in Sources */ = {isa = PBXBuildFile; fileRef = E26747B3154A5DBC3A7E24A5 /* Image.swift */; }; 0437765FF480249486893CC7 /* ScreenTrackerViewModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 196004E7695FBA292A7944AF /* ScreenTrackerViewModifier.swift */; }; 044DD8F80231BC30570F7965 /* UserDiscoveryService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65AAD845E53B0C8B5E0812C2 /* UserDiscoveryService.swift */; }; 04778AA4D6AD2E153D7AAFF2 /* CallScreenUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1D8866FE1CCCF10305FCACBC /* CallScreenUITests.swift */; }; @@ -468,7 +467,6 @@ 7A0A0929556792FB19B812C5 /* SessionVerificationScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84816E0D2F34E368BF64FA60 /* SessionVerificationScreen.swift */; }; 7A642EE5F1ADC5D520F21924 /* MediaProviderProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 85EB16E7FE59A947CA441531 /* MediaProviderProtocol.swift */; }; 7A71AEF419904209BB8C2833 /* UserAgentBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1F2529D434C750ED78ADF1ED /* UserAgentBuilder.swift */; }; - 7ABAB3A1D52B86FACF2F74CF /* MapTilerGeoCodingServiceProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = C23B3FAD8B23C421BC0D1B1E /* MapTilerGeoCodingServiceProtocol.swift */; }; 7AEC56ADEFC5A7198A17412F /* InviteUsersScreenUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADB35E2DB4EFE8E6F3959629 /* InviteUsersScreenUITests.swift */; }; 7B5DAB915357BE596529BF25 /* MapTilerStaticMapProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20872C3887F835958CE2F1D0 /* MapTilerStaticMapProtocol.swift */; }; 7BB31E67648CF32D2AB5E502 /* RoomScreenViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9CE3C90E487B255B735D73C8 /* RoomScreenViewModel.swift */; }; @@ -1052,7 +1050,7 @@ 033DB41C51865A2E83174E87 /* target.yml */ = {isa = PBXFileReference; lastKnownFileType = text.yaml; path = target.yml; sourceTree = ""; }; 035177BCD8E8308B098AC3C2 /* WindowManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WindowManager.swift; sourceTree = ""; }; 0376C429FAB1687C3D905F3E /* MockCoder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockCoder.swift; sourceTree = ""; }; - 0392E3FDE372C9B56FEEED8B /* test_voice_message.m4a */ = {isa = PBXFileReference; path = test_voice_message.m4a; sourceTree = ""; }; + 0392E3FDE372C9B56FEEED8B /* test_voice_message.m4a */ = {isa = PBXFileReference; lastKnownFileType = file; path = test_voice_message.m4a; sourceTree = ""; }; 03DD998E523D4EC93C7ED703 /* RoomNotificationSettingsScreenViewModelProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomNotificationSettingsScreenViewModelProtocol.swift; sourceTree = ""; }; 03FABD73FD8086EFAB699F42 /* MediaUploadPreviewScreenViewModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MediaUploadPreviewScreenViewModelTests.swift; sourceTree = ""; }; 044E501B8331B339874D1B96 /* CompoundIcon.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CompoundIcon.swift; sourceTree = ""; }; @@ -1110,7 +1108,7 @@ 127C8472672A5BA09EF1ACF8 /* CurrentValuePublisher.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CurrentValuePublisher.swift; sourceTree = ""; }; 12EDAFB64FA5F6812D54F39A /* MigrationScreenViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MigrationScreenViewModel.swift; sourceTree = ""; }; 12F1E7F9C2BE8BB751037826 /* WaitlistScreenCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WaitlistScreenCoordinator.swift; sourceTree = ""; }; - 1304D9191300873EADA52D6E /* IntegrationTests.xctestplan */ = {isa = PBXFileReference; path = IntegrationTests.xctestplan; sourceTree = ""; }; + 1304D9191300873EADA52D6E /* IntegrationTests.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = IntegrationTests.xctestplan; sourceTree = ""; }; 130ED565A078F7E0B59D9D25 /* UNTextInputNotificationResponse+Creator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UNTextInputNotificationResponse+Creator.swift"; sourceTree = ""; }; 13802897C7AFA360EA74C0B0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = en; path = en.lproj/Localizable.stringsdict; sourceTree = ""; }; 1423AB065857FA546444DB15 /* NotificationManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationManager.swift; sourceTree = ""; }; @@ -1531,7 +1529,7 @@ 8D55702474F279D910D2D162 /* RoomStateEventStringBuilder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomStateEventStringBuilder.swift; sourceTree = ""; }; 8D8169443E5AC5FF71BFB3DB /* cs */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = cs; path = cs.lproj/Localizable.strings; sourceTree = ""; }; 8DC2C9E0E15C79BBDA80F0A2 /* TimelineStyle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimelineStyle.swift; sourceTree = ""; }; - 8E088F2A1B9EC529D3221931 /* UITests.xctestplan */ = {isa = PBXFileReference; path = UITests.xctestplan; sourceTree = ""; }; + 8E088F2A1B9EC529D3221931 /* UITests.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = UITests.xctestplan; sourceTree = ""; }; 8E1BBA73B611EDEEA6E20E05 /* InvitesScreenModels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InvitesScreenModels.swift; sourceTree = ""; }; 8EC57A32ABC80D774CC663DB /* SettingsScreenUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsScreenUITests.swift; sourceTree = ""; }; 8F21ED7205048668BEB44A38 /* AppActivityView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppActivityView.swift; sourceTree = ""; }; @@ -1666,7 +1664,7 @@ B50F03079F6B5EF9CA005F14 /* TimelineProxyProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimelineProxyProtocol.swift; sourceTree = ""; }; B590BD4507D4F0A377FDE01A /* LoadableAvatarImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoadableAvatarImage.swift; sourceTree = ""; }; B5B243E7818E5E9F6A4EDC7A /* NoticeRoomTimelineView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NoticeRoomTimelineView.swift; sourceTree = ""; }; - B61C339A2FDDBD067FF6635C /* ConfettiScene.scn */ = {isa = PBXFileReference; path = ConfettiScene.scn; sourceTree = ""; }; + B61C339A2FDDBD067FF6635C /* ConfettiScene.scn */ = {isa = PBXFileReference; lastKnownFileType = file.bplist; path = ConfettiScene.scn; sourceTree = ""; }; B6311F21F911E23BE4DF51B4 /* ReadMarkerRoomTimelineView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReadMarkerRoomTimelineView.swift; sourceTree = ""; }; B63B69F9A2BC74DD40DC75C8 /* AdvancedSettingsScreenViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdvancedSettingsScreenViewModel.swift; sourceTree = ""; }; B697816AF93DA06EC58C5D70 /* WaitlistScreenViewModelProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WaitlistScreenViewModelProtocol.swift; sourceTree = ""; }; @@ -1717,7 +1715,6 @@ C18CC37B97E77838609CFFE7 /* AdvancedSettingsScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdvancedSettingsScreen.swift; sourceTree = ""; }; C1D737F4672021D0A7D218CD /* OIDCAccountSettingsPresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OIDCAccountSettingsPresenter.swift; sourceTree = ""; }; C1FA515B3B0D61EF1E907D2D /* BadgeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BadgeView.swift; sourceTree = ""; }; - C23B3FAD8B23C421BC0D1B1E /* MapTilerGeoCodingServiceProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapTilerGeoCodingServiceProtocol.swift; sourceTree = ""; }; C2886615BEBAE33A0AA4D5F8 /* RoomScreenModels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomScreenModels.swift; sourceTree = ""; }; C2E9B841EE4878283ECDB554 /* InviteUsersScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InviteUsersScreen.swift; sourceTree = ""; }; C2F079B5DBD0D85FEA687AAE /* SDKGeneratedMocks.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SDKGeneratedMocks.swift; sourceTree = ""; }; @@ -1771,7 +1768,7 @@ CD95B3714F806AC9CF9A557B /* ComposerToolbarViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ComposerToolbarViewModel.swift; sourceTree = ""; }; CDB3227C7A74B734924942E9 /* RoomSummaryProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomSummaryProvider.swift; sourceTree = ""; }; CEE0E6043EFCF6FD2A341861 /* TimelineReplyView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimelineReplyView.swift; sourceTree = ""; }; - CEE41494C837AA403A06A5D9 /* UnitTests.xctestplan */ = {isa = PBXFileReference; path = UnitTests.xctestplan; sourceTree = ""; }; + CEE41494C837AA403A06A5D9 /* UnitTests.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = UnitTests.xctestplan; sourceTree = ""; }; CF48AF076424DBC1615C74AD /* AuthenticationServiceProxy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthenticationServiceProxy.swift; sourceTree = ""; }; D0140615D2232612C813FD6C /* EncryptedHistoryRoomTimelineItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EncryptedHistoryRoomTimelineItem.swift; sourceTree = ""; }; D071F86CD47582B9196C9D16 /* UserDiscoverySection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserDiscoverySection.swift; sourceTree = ""; }; @@ -1833,7 +1830,6 @@ E1A5FEF17ED7E6176D922D4F /* RoomDetailsScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomDetailsScreen.swift; sourceTree = ""; }; E1E0B4A34E69BD2132BEC521 /* MessageText.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessageText.swift; sourceTree = ""; }; E24B88AD3D1599E8CB1376E0 /* AvatarSize.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AvatarSize.swift; sourceTree = ""; }; - E26747B3154A5DBC3A7E24A5 /* Image.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Image.swift; sourceTree = ""; }; E26C69EC1157D71CC61ADAE4 /* ScaledPaddingModifier.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScaledPaddingModifier.swift; sourceTree = ""; }; E2B1CC9AA154F4D5435BF60A /* Comparable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Comparable.swift; sourceTree = ""; }; E2DCA495ED42D2463DDAA94D /* TimelineBubbleLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimelineBubbleLayout.swift; sourceTree = ""; }; @@ -1876,7 +1872,7 @@ ECF79FB25E2D4BD6F50CE7C9 /* RoomMembersListScreenViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomMembersListScreenViewModel.swift; sourceTree = ""; }; ED044D00F2176681CC02CD54 /* HomeScreenRoomCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeScreenRoomCell.swift; sourceTree = ""; }; ED1D792EB82506A19A72C8DE /* RoomTimelineItemProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomTimelineItemProtocol.swift; sourceTree = ""; }; - ED482057AE39D5C6D9C5F3D8 /* message.caf */ = {isa = PBXFileReference; path = message.caf; sourceTree = ""; }; + ED482057AE39D5C6D9C5F3D8 /* message.caf */ = {isa = PBXFileReference; lastKnownFileType = file; path = message.caf; sourceTree = ""; }; ED983D4DCA5AFA6E1ED96099 /* StateRoomTimelineView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StateRoomTimelineView.swift; sourceTree = ""; }; EDAA4472821985BF868CC21C /* ServerSelectionViewModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ServerSelectionViewModelTests.swift; sourceTree = ""; }; EE378083653EF0C9B5E9D580 /* EmoteRoomTimelineItemContent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmoteRoomTimelineItemContent.swift; sourceTree = ""; }; @@ -1892,7 +1888,7 @@ F174A5627CDB3CAF280D1880 /* EmojiPickerScreenModels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmojiPickerScreenModels.swift; sourceTree = ""; }; F17EFA1D3D09FC2F9C5E1CB2 /* MediaProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MediaProvider.swift; sourceTree = ""; }; F1B8500C152BC59445647DA8 /* UnsupportedRoomTimelineItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UnsupportedRoomTimelineItem.swift; sourceTree = ""; }; - F2D513D2477B57F90E98EEC0 /* portrait_test_video.mp4 */ = {isa = PBXFileReference; path = portrait_test_video.mp4; sourceTree = ""; }; + F2D513D2477B57F90E98EEC0 /* portrait_test_video.mp4 */ = {isa = PBXFileReference; lastKnownFileType = file; path = portrait_test_video.mp4; sourceTree = ""; }; F31F59030205A6F65B057E1A /* MatrixEntityRegexTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MatrixEntityRegexTests.swift; sourceTree = ""; }; F348B5F2C12F9D4F4B4D3884 /* VideoRoomTimelineItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VideoRoomTimelineItem.swift; sourceTree = ""; }; F36C0A6D59717193F49EA986 /* UserSessionTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserSessionTests.swift; sourceTree = ""; }; @@ -2730,7 +2726,6 @@ 7FB2253D36E81E045E1CB432 /* Duration.swift */, 260004737C573A56FA01E86E /* Encodable.swift */, 04DF593C3F7AF4B2FBAEB05D /* FileManager.swift */, - E26747B3154A5DBC3A7E24A5 /* Image.swift */, 4E2245243369B99216C7D84E /* ImageCache.swift */, 045253F9967A535EE5B16691 /* Label.swift */, C14D83B2B7CD5501A0089EFC /* LayoutDirection.swift */, @@ -4220,7 +4215,6 @@ B81B6170DB690013CEB646F4 /* MapLibreModels.swift */, 592A35163B0749C66BFD6186 /* MapLibreStaticMapView.swift */, E062C1750EFC8627DE4CAB8E /* MapTilerAuthorization.swift */, - C23B3FAD8B23C421BC0D1B1E /* MapTilerGeoCodingServiceProtocol.swift */, 1A4D29F2683F5772AC72406F /* MapTilerStaticMap.swift */, 20872C3887F835958CE2F1D0 /* MapTilerStaticMapProtocol.swift */, F0B9F5BC4C80543DE7228B9D /* MapTilerStyle.swift */, @@ -5442,7 +5436,6 @@ D3986615892E7CF05C86518A /* HomeScreenUserMenuButton.swift in Sources */, DE4F8C4E0F1DB4832F09DE97 /* HomeScreenViewModel.swift in Sources */, 56F0A22972A3BB519DA2261C /* HomeScreenViewModelProtocol.swift in Sources */, - 03D684A3AE85A23B3DA3B43F /* Image.swift in Sources */, BA31448FBD9697F8CB9A83CD /* ImageCache.swift in Sources */, 85813D87DDD7F67A46BD9AF7 /* ImageProviderProtocol.swift in Sources */, 7CD16990BA843BE9ED639129 /* ImageRoomTimelineItem.swift in Sources */, @@ -5499,7 +5492,6 @@ E2DDA49BD62F03F180A42E30 /* MapLibreStaticMapView.swift in Sources */, D181AC8FF236B7F91C0A8C28 /* MapTiler.swift in Sources */, FCDA202B246F75BA28E10C5F /* MapTilerAuthorization.swift in Sources */, - 7ABAB3A1D52B86FACF2F74CF /* MapTilerGeoCodingServiceProtocol.swift in Sources */, D6661A94DBD97658B2ADBD6A /* MapTilerStaticMap.swift in Sources */, 7B5DAB915357BE596529BF25 /* MapTilerStaticMapProtocol.swift in Sources */, 83A4DAB181C56987C3E804FF /* MapTilerStyle.swift in Sources */, @@ -6092,9 +6084,7 @@ "@executable_path/../../Frameworks", ); MARKETING_VERSION = "$(MARKETING_VERSION)"; - OTHER_SWIFT_FLAGS = ( - "-DIS_NSE", - ); + OTHER_SWIFT_FLAGS = "-DIS_NSE"; PRODUCT_BUNDLE_IDENTIFIER = "${BASE_BUNDLE_IDENTIFIER}.nse"; PRODUCT_DISPLAY_NAME = "$(APP_DISPLAY_NAME)"; PRODUCT_NAME = NSE; @@ -6125,9 +6115,7 @@ "@executable_path/Frameworks", ); MARKETING_VERSION = "$(MARKETING_VERSION)"; - OTHER_SWIFT_FLAGS = ( - "-DIS_MAIN_APP", - ); + OTHER_SWIFT_FLAGS = "-DIS_MAIN_APP"; PILLS_UT_TYPE_IDENTIFIER = "$(BASE_BUNDLE_IDENTIFIER).pills"; PRODUCT_BUNDLE_IDENTIFIER = "$(BASE_BUNDLE_IDENTIFIER)"; PRODUCT_NAME = "$(APP_NAME)"; @@ -6153,9 +6141,7 @@ "@executable_path/Frameworks", ); MARKETING_VERSION = "$(MARKETING_VERSION)"; - OTHER_SWIFT_FLAGS = ( - "-DIS_MAIN_APP", - ); + OTHER_SWIFT_FLAGS = "-DIS_MAIN_APP"; PILLS_UT_TYPE_IDENTIFIER = "$(BASE_BUNDLE_IDENTIFIER).pills"; PRODUCT_BUNDLE_IDENTIFIER = "$(BASE_BUNDLE_IDENTIFIER)"; PRODUCT_NAME = "$(APP_NAME)"; @@ -6398,9 +6384,7 @@ "@executable_path/../../Frameworks", ); MARKETING_VERSION = "$(MARKETING_VERSION)"; - OTHER_SWIFT_FLAGS = ( - "-DIS_NSE", - ); + OTHER_SWIFT_FLAGS = "-DIS_NSE"; PRODUCT_BUNDLE_IDENTIFIER = "${BASE_BUNDLE_IDENTIFIER}.nse"; PRODUCT_DISPLAY_NAME = "$(APP_DISPLAY_NAME)"; PRODUCT_NAME = NSE; diff --git a/ElementX/Sources/Application/AppSettings.swift b/ElementX/Sources/Application/AppSettings.swift index 61ad94d5a..0d90b729d 100644 --- a/ElementX/Sources/Application/AppSettings.swift +++ b/ElementX/Sources/Application/AppSettings.swift @@ -144,7 +144,7 @@ final class AppSettings { /// Any pre-defined static client registrations for OIDC issuers. let oidcStaticRegistrations: [URL: String] = ["https://id.thirdroom.io/realms/thirdroom": "elementx"] /// The redirect URL used for OIDC. - let oidcRedirectURL: URL = "io.element:/callback" + let oidcRedirectURL = URL(string: "\(InfoPlistReader.main.appScheme):/callback")! /// The date that the call to `/login` completed successfully. This is used to put /// a hard wall on the history of encrypted messages until we have key backup. diff --git a/ElementX/Sources/Application/Navigation/NavigationCoordinators.swift b/ElementX/Sources/Application/Navigation/NavigationCoordinators.swift index defbc9b27..cc61371c7 100644 --- a/ElementX/Sources/Application/Navigation/NavigationCoordinators.swift +++ b/ElementX/Sources/Application/Navigation/NavigationCoordinators.swift @@ -22,8 +22,6 @@ import SwiftUI class NavigationSplitCoordinator: CoordinatorProtocol, ObservableObject, CustomStringConvertible { fileprivate let placeholderModule: NavigationModule - private var cancellables = Set() - var sidebarStackModuleCancellable: AnyCancellable? @Published fileprivate var sidebarModule: NavigationModule? { @@ -111,6 +109,7 @@ class NavigationSplitCoordinator: CoordinatorProtocol, ObservableObject, CustomS } } + // periphery:ignore - might be useful to have /// The currently displayed fullscreen cover coordinator var fullScreenCoverCoordinator: (any CoordinatorProtocol)? { fullScreenCoverModule?.coordinator @@ -502,6 +501,7 @@ class NavigationStackCoordinator: ObservableObject, CoordinatorProtocol, CustomS } } + // periphery:ignore - might be useful to have // The currently presented fullscreen cover coordinator // Fullscreen covers will be presented through the NavigationSplitCoordinator if provided var fullScreenCoverCoordinator: (any CoordinatorProtocol)? { @@ -636,6 +636,7 @@ class NavigationStackCoordinator: ObservableObject, CoordinatorProtocol, CustomS } } + // periphery:ignore - might be useful to have /// Present a fullscreen cover on top of the stack. If this NavigationStackCoordinator is embedded within a NavigationSplitCoordinator /// then the presentation will be proxied to the split /// - Parameters: diff --git a/ElementX/Sources/Application/Navigation/NavigationRootCoordinator.swift b/ElementX/Sources/Application/Navigation/NavigationRootCoordinator.swift index f07e8f1b7..682f3c878 100644 --- a/ElementX/Sources/Application/Navigation/NavigationRootCoordinator.swift +++ b/ElementX/Sources/Application/Navigation/NavigationRootCoordinator.swift @@ -49,6 +49,7 @@ class NavigationRootCoordinator: ObservableObject, CoordinatorProtocol, CustomSt } } + // periphery:ignore - might be useful to have // The currently presented sheet coordinator // Sheets will be presented through the NavigationSplitCoordinator if provided var sheetCoordinator: (any CoordinatorProtocol)? { diff --git a/ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift b/ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift index 923642b5b..4ebf14fd2 100644 --- a/ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift +++ b/ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift @@ -254,7 +254,7 @@ class RoomFlowCoordinator: FlowCoordinatorProtocol { break case (.notificationSettings, .presentGlobalNotificationSettingsScreen, .globalNotificationSettings): - presentGlobalNotificationSettingsScreen(animated: animated) + presentGlobalNotificationSettingsScreen() case (.globalNotificationSettings, .dismissGlobalNotificationSettingsScreen, .notificationSettings): break @@ -981,7 +981,7 @@ class RoomFlowCoordinator: FlowCoordinatorProtocol { } } - private func presentGlobalNotificationSettingsScreen(animated: Bool) { + private func presentGlobalNotificationSettingsScreen() { let navigationCoordinator = NavigationStackCoordinator() let parameters = NotificationSettingsScreenCoordinatorParameters(navigationStackCoordinator: navigationCoordinator, userSession: userSession, diff --git a/ElementX/Sources/Mocks/Generated/GeneratedMocks.swift b/ElementX/Sources/Mocks/Generated/GeneratedMocks.swift index f32148ab7..5f47be148 100644 --- a/ElementX/Sources/Mocks/Generated/GeneratedMocks.swift +++ b/ElementX/Sources/Mocks/Generated/GeneratedMocks.swift @@ -813,27 +813,6 @@ class KeychainControllerMock: KeychainControllerProtocol { setRestorationTokenForUsernameReceivedInvocations.append((restorationToken: restorationToken, forUsername: forUsername)) setRestorationTokenForUsernameClosure?(restorationToken, forUsername) } - //MARK: - restorationTokenForUsername - - var restorationTokenForUsernameCallsCount = 0 - var restorationTokenForUsernameCalled: Bool { - return restorationTokenForUsernameCallsCount > 0 - } - var restorationTokenForUsernameReceivedUsername: String? - var restorationTokenForUsernameReceivedInvocations: [String] = [] - var restorationTokenForUsernameReturnValue: RestorationToken? - var restorationTokenForUsernameClosure: ((String) -> RestorationToken?)? - - func restorationTokenForUsername(_ username: String) -> RestorationToken? { - restorationTokenForUsernameCallsCount += 1 - restorationTokenForUsernameReceivedUsername = username - restorationTokenForUsernameReceivedInvocations.append(username) - if let restorationTokenForUsernameClosure = restorationTokenForUsernameClosure { - return restorationTokenForUsernameClosure(username) - } else { - return restorationTokenForUsernameReturnValue - } - } //MARK: - restorationTokens var restorationTokensCallsCount = 0 @@ -879,18 +858,6 @@ class KeychainControllerMock: KeychainControllerProtocol { removeAllRestorationTokensCallsCount += 1 removeAllRestorationTokensClosure?() } - //MARK: - resetSecrets - - var resetSecretsCallsCount = 0 - var resetSecretsCalled: Bool { - return resetSecretsCallsCount > 0 - } - var resetSecretsClosure: (() -> Void)? - - func resetSecrets() { - resetSecretsCallsCount += 1 - resetSecretsClosure?() - } //MARK: - containsPINCode var containsPINCodeThrowableError: Error? @@ -1227,16 +1194,6 @@ class NetworkMonitorMock: NetworkMonitorProtocol { set(value) { underlyingReachabilityPublisher = value } } var underlyingReachabilityPublisher: CurrentValuePublisher! - var isCurrentConnectionExpensive: Bool { - get { return underlyingIsCurrentConnectionExpensive } - set(value) { underlyingIsCurrentConnectionExpensive = value } - } - var underlyingIsCurrentConnectionExpensive: Bool! - var isCurrentConnectionConstrained: Bool { - get { return underlyingIsCurrentConnectionConstrained } - set(value) { underlyingIsCurrentConnectionConstrained = value } - } - var underlyingIsCurrentConnectionConstrained: Bool! } class NotificationCenterMock: NotificationCenterProtocol { @@ -1493,23 +1450,6 @@ class NotificationSettingsProxyMock: NotificationSettingsProxyProtocol { restoreDefaultNotificationModeRoomIdReceivedInvocations.append(roomId) try await restoreDefaultNotificationModeRoomIdClosure?(roomId) } - //MARK: - containsKeywordsRules - - var containsKeywordsRulesCallsCount = 0 - var containsKeywordsRulesCalled: Bool { - return containsKeywordsRulesCallsCount > 0 - } - var containsKeywordsRulesReturnValue: Bool! - var containsKeywordsRulesClosure: (() async -> Bool)? - - func containsKeywordsRules() async -> Bool { - containsKeywordsRulesCallsCount += 1 - if let containsKeywordsRulesClosure = containsKeywordsRulesClosure { - return await containsKeywordsRulesClosure() - } else { - return containsKeywordsRulesReturnValue - } - } //MARK: - unmuteRoom var unmuteRoomRoomIdIsEncryptedIsOneToOneThrowableError: Error? @@ -1571,47 +1511,6 @@ class NotificationSettingsProxyMock: NotificationSettingsProxyProtocol { setRoomMentionEnabledEnabledReceivedInvocations.append(enabled) try await setRoomMentionEnabledEnabledClosure?(enabled) } - //MARK: - isUserMentionEnabled - - var isUserMentionEnabledThrowableError: Error? - var isUserMentionEnabledCallsCount = 0 - var isUserMentionEnabledCalled: Bool { - return isUserMentionEnabledCallsCount > 0 - } - var isUserMentionEnabledReturnValue: Bool! - var isUserMentionEnabledClosure: (() async throws -> Bool)? - - func isUserMentionEnabled() async throws -> Bool { - if let error = isUserMentionEnabledThrowableError { - throw error - } - isUserMentionEnabledCallsCount += 1 - if let isUserMentionEnabledClosure = isUserMentionEnabledClosure { - return try await isUserMentionEnabledClosure() - } else { - return isUserMentionEnabledReturnValue - } - } - //MARK: - setUserMentionEnabled - - var setUserMentionEnabledEnabledThrowableError: Error? - var setUserMentionEnabledEnabledCallsCount = 0 - var setUserMentionEnabledEnabledCalled: Bool { - return setUserMentionEnabledEnabledCallsCount > 0 - } - var setUserMentionEnabledEnabledReceivedEnabled: Bool? - var setUserMentionEnabledEnabledReceivedInvocations: [Bool] = [] - var setUserMentionEnabledEnabledClosure: ((Bool) async throws -> Void)? - - func setUserMentionEnabled(enabled: Bool) async throws { - if let error = setUserMentionEnabledEnabledThrowableError { - throw error - } - setUserMentionEnabledEnabledCallsCount += 1 - setUserMentionEnabledEnabledReceivedEnabled = enabled - setUserMentionEnabledEnabledReceivedInvocations.append(enabled) - try await setUserMentionEnabledEnabledClosure?(enabled) - } //MARK: - isCallEnabled var isCallEnabledThrowableError: Error? @@ -1746,21 +1645,6 @@ class RoomMemberProxyMock: RoomMemberProxyProtocol { set(value) { underlyingMembership = value } } var underlyingMembership: MembershipState! - var isNameAmbiguous: Bool { - get { return underlyingIsNameAmbiguous } - set(value) { underlyingIsNameAmbiguous = value } - } - var underlyingIsNameAmbiguous: Bool! - var powerLevel: Int { - get { return underlyingPowerLevel } - set(value) { underlyingPowerLevel = value } - } - var underlyingPowerLevel: Int! - var normalizedPowerLevel: Int { - get { return underlyingNormalizedPowerLevel } - set(value) { underlyingNormalizedPowerLevel = value } - } - var underlyingNormalizedPowerLevel: Int! var isAccountOwner: Bool { get { return underlyingIsAccountOwner } set(value) { underlyingIsAccountOwner = value } @@ -1872,11 +1756,6 @@ class RoomProxyMock: RoomProxyProtocol { set(value) { underlyingIsEncrypted = value } } var underlyingIsEncrypted: Bool! - var isTombstoned: Bool { - get { return underlyingIsTombstoned } - set(value) { underlyingIsTombstoned = value } - } - var underlyingIsTombstoned: Bool! var membership: Membership { get { return underlyingMembership } set(value) { underlyingMembership = value } @@ -1888,7 +1767,6 @@ class RoomProxyMock: RoomProxyProtocol { } var underlyingHasOngoingCall: Bool! var canonicalAlias: String? - var alternativeAliases: [String] = [] var hasUnreadNotifications: Bool { get { return underlyingHasUnreadNotifications } set(value) { underlyingHasUnreadNotifications = value } @@ -1908,11 +1786,6 @@ class RoomProxyMock: RoomProxyProtocol { set(value) { underlyingMembers = value } } var underlyingMembers: CurrentValuePublisher<[RoomMemberProxyProtocol], Never>! - var invitedMembersCount: Int { - get { return underlyingInvitedMembersCount } - set(value) { underlyingInvitedMembersCount = value } - } - var underlyingInvitedMembersCount: Int! var joinedMembersCount: Int { get { return underlyingJoinedMembersCount } set(value) { underlyingJoinedMembersCount = value } @@ -1933,11 +1806,6 @@ class RoomProxyMock: RoomProxyProtocol { set(value) { underlyingTimeline = value } } var underlyingTimeline: TimelineProxyProtocol! - var pollHistoryTimeline: TimelineProxyProtocol { - get { return underlyingPollHistoryTimeline } - set(value) { underlyingPollHistoryTimeline = value } - } - var underlyingPollHistoryTimeline: TimelineProxyProtocol! //MARK: - subscribeForUpdates @@ -1951,48 +1819,6 @@ class RoomProxyMock: RoomProxyProtocol { subscribeForUpdatesCallsCount += 1 await subscribeForUpdatesClosure?() } - //MARK: - loadAvatarURLForUserId - - var loadAvatarURLForUserIdCallsCount = 0 - var loadAvatarURLForUserIdCalled: Bool { - return loadAvatarURLForUserIdCallsCount > 0 - } - var loadAvatarURLForUserIdReceivedUserId: String? - var loadAvatarURLForUserIdReceivedInvocations: [String] = [] - var loadAvatarURLForUserIdReturnValue: Result! - var loadAvatarURLForUserIdClosure: ((String) async -> Result)? - - func loadAvatarURLForUserId(_ userId: String) async -> Result { - loadAvatarURLForUserIdCallsCount += 1 - loadAvatarURLForUserIdReceivedUserId = userId - loadAvatarURLForUserIdReceivedInvocations.append(userId) - if let loadAvatarURLForUserIdClosure = loadAvatarURLForUserIdClosure { - return await loadAvatarURLForUserIdClosure(userId) - } else { - return loadAvatarURLForUserIdReturnValue - } - } - //MARK: - loadDisplayNameForUserId - - var loadDisplayNameForUserIdCallsCount = 0 - var loadDisplayNameForUserIdCalled: Bool { - return loadDisplayNameForUserIdCallsCount > 0 - } - var loadDisplayNameForUserIdReceivedUserId: String? - var loadDisplayNameForUserIdReceivedInvocations: [String] = [] - var loadDisplayNameForUserIdReturnValue: Result! - var loadDisplayNameForUserIdClosure: ((String) async -> Result)? - - func loadDisplayNameForUserId(_ userId: String) async -> Result { - loadDisplayNameForUserIdCallsCount += 1 - loadDisplayNameForUserIdReceivedUserId = userId - loadDisplayNameForUserIdReceivedInvocations.append(userId) - if let loadDisplayNameForUserIdClosure = loadDisplayNameForUserIdClosure { - return await loadDisplayNameForUserIdClosure(userId) - } else { - return loadDisplayNameForUserIdReturnValue - } - } //MARK: - redact var redactCallsCount = 0 @@ -2106,23 +1932,6 @@ class RoomProxyMock: RoomProxyProtocol { return getMemberUserIDReturnValue } } - //MARK: - inviter - - var inviterCallsCount = 0 - var inviterCalled: Bool { - return inviterCallsCount > 0 - } - var inviterReturnValue: RoomMemberProxyProtocol? - var inviterClosure: (() async -> RoomMemberProxyProtocol?)? - - func inviter() async -> RoomMemberProxyProtocol? { - inviterCallsCount += 1 - if let inviterClosure = inviterClosure { - return await inviterClosure() - } else { - return inviterReturnValue - } - } //MARK: - rejectInvitation var rejectInvitationCallsCount = 0 diff --git a/ElementX/Sources/Mocks/RoomMemberProxyMock.swift b/ElementX/Sources/Mocks/RoomMemberProxyMock.swift index 10324fa9b..30b3a0fd7 100644 --- a/ElementX/Sources/Mocks/RoomMemberProxyMock.swift +++ b/ElementX/Sources/Mocks/RoomMemberProxyMock.swift @@ -22,9 +22,6 @@ struct RoomMemberProxyMockConfiguration { var displayName: String var avatarURL: URL? var membership: MembershipState - var isNameAmbiguous = false - var powerLevel = 50 - var normalizedPowerLevel = 50 var isAccountOwner = false var isIgnored = false var canInviteUsers = false @@ -38,9 +35,6 @@ extension RoomMemberProxyMock { displayName = configuration.displayName avatarURL = configuration.avatarURL membership = configuration.membership - isNameAmbiguous = configuration.isNameAmbiguous - powerLevel = configuration.powerLevel - normalizedPowerLevel = configuration.normalizedPowerLevel isAccountOwner = configuration.isAccountOwner isIgnored = configuration.isIgnored canInviteUsers = configuration.canInviteUsers diff --git a/ElementX/Sources/Mocks/RoomProxyMock.swift b/ElementX/Sources/Mocks/RoomProxyMock.swift index b632ace75..b1e205f4a 100644 --- a/ElementX/Sources/Mocks/RoomProxyMock.swift +++ b/ElementX/Sources/Mocks/RoomProxyMock.swift @@ -27,7 +27,6 @@ struct RoomProxyMockConfiguration { var isSpace = Bool.random() var isPublic = Bool.random() var isEncrypted = true - var isTombstoned = Bool.random() var hasOngoingCall = false var canonicalAlias: String? var alternativeAliases: [String] = [] @@ -40,7 +39,6 @@ struct RoomProxyMockConfiguration { }() var members: [RoomMemberProxyProtocol]? - var inviter: RoomMemberProxyMock? var memberForID: RoomMemberProxyMock = .mockMe var ownUserID = "@alice:somewhere.org" @@ -65,15 +63,12 @@ extension RoomProxyMock { isSpace = configuration.isSpace isPublic = configuration.isPublic isEncrypted = configuration.isEncrypted - isTombstoned = configuration.isTombstoned hasOngoingCall = configuration.hasOngoingCall canonicalAlias = configuration.canonicalAlias - alternativeAliases = configuration.alternativeAliases hasUnreadNotifications = configuration.hasUnreadNotifications timeline = configuration.timeline - invitedMembersCount = configuration.invitedMembersCount joinedMembersCount = configuration.joinedMembersCount activeMembersCount = configuration.activeMembersCount ownUserID = configuration.ownUserID @@ -83,10 +78,6 @@ extension RoomProxyMock { } else { members = CurrentValueSubject([]).asCurrentValuePublisher() } - - if let inviter = configuration.inviter { - inviterClosure = { inviter } - } updateMembersClosure = { } acceptInvitationClosure = { .success(()) } diff --git a/ElementX/Sources/Other/Extensions/Alert.swift b/ElementX/Sources/Other/Extensions/Alert.swift index 99474c741..e32748911 100644 --- a/ElementX/Sources/Other/Extensions/Alert.swift +++ b/ElementX/Sources/Other/Extensions/Alert.swift @@ -95,6 +95,7 @@ extension AlertInfo { message = L10n.errorUnknown } + // periphery: ignore - might be useful in the future /// Initialises the type with the title from an `Error`'s localised description along with the default Ok button. /// /// Currently this initialiser creates an alert for every error, however in the future it may be updated to filter diff --git a/ElementX/Sources/Other/Extensions/Image.swift b/ElementX/Sources/Other/Extensions/Image.swift deleted file mode 100644 index 9062327eb..000000000 --- a/ElementX/Sources/Other/Extensions/Image.swift +++ /dev/null @@ -1,22 +0,0 @@ -// -// Copyright 2022 New Vector Ltd -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -import SwiftUI - -extension Image { - /// Empty image view - static let empty = Image(uiImage: .init(ciImage: .empty())) -} diff --git a/ElementX/Sources/Other/Extensions/NSRegularExpresion.swift b/ElementX/Sources/Other/Extensions/NSRegularExpresion.swift index 8d7fd38f6..56ab3aaa5 100644 --- a/ElementX/Sources/Other/Extensions/NSRegularExpresion.swift +++ b/ElementX/Sources/Other/Extensions/NSRegularExpresion.swift @@ -18,23 +18,11 @@ import Foundation /// NSRegularExpressions work internally on NSStrings, we need to be careful how we build the ranges for extended grapheme clusters https://stackoverflow.com/a/27880748/730924 extension NSRegularExpression { - func enumerateMatches(in string: String, options: NSRegularExpression.MatchingOptions = [], using block: (NSTextCheckingResult?, NSRegularExpression.MatchingFlags, UnsafeMutablePointer) -> Void) { - enumerateMatches(in: string, options: options, range: .init(location: 0, length: (string as NSString).length), using: block) - } - func matches(in string: String, options: NSRegularExpression.MatchingOptions = []) -> [NSTextCheckingResult] { matches(in: string, options: options, range: .init(location: 0, length: (string as NSString).length)) } - func numberOfMatches(in string: String, options: NSRegularExpression.MatchingOptions = []) -> Int { - numberOfMatches(in: string, options: options, range: .init(location: 0, length: (string as NSString).length)) - } - func firstMatch(in string: String, options: NSRegularExpression.MatchingOptions = []) -> NSTextCheckingResult? { firstMatch(in: string, options: options, range: .init(location: 0, length: (string as NSString).length)) } - - func rangeOfFirstMatch(in string: String, options: NSRegularExpression.MatchingOptions = []) -> NSRange { - rangeOfFirstMatch(in: string, options: options, range: .init(location: 0, length: (string as NSString).length)) - } } diff --git a/ElementX/Sources/Other/Extensions/PlatformViewVersionPredicate.swift b/ElementX/Sources/Other/Extensions/PlatformViewVersionPredicate.swift index 8cc6659e8..664e8ce24 100644 --- a/ElementX/Sources/Other/Extensions/PlatformViewVersionPredicate.swift +++ b/ElementX/Sources/Other/Extensions/PlatformViewVersionPredicate.swift @@ -41,9 +41,3 @@ extension PlatformViewVersionPredicate { .iOS(.v16, .v17) } } - -extension PlatformViewVersionPredicate { - static var supportedVersions: Self { - .iOS(.v16, .v17) - } -} diff --git a/ElementX/Sources/Other/Logging/MXLog.swift b/ElementX/Sources/Other/Logging/MXLog.swift index e89b01c09..6961b1ccf 100644 --- a/ElementX/Sources/Other/Logging/MXLog.swift +++ b/ElementX/Sources/Other/Logging/MXLog.swift @@ -160,6 +160,7 @@ enum MXLog { // MARK: - Private + // periphery:ignore:parameters function,column private static func createSpan(_ name: String, level: LogLevel, file: String = #file, @@ -177,6 +178,7 @@ enum MXLog { return Span(file: file, line: UInt32(line), level: level, target: target, name: name) } + // periphery:ignore:parameters function,column,context private static func log(_ message: Any, level: LogLevel, file: String = #file, diff --git a/ElementX/Sources/Other/MapLibre/MapLibreMapView.swift b/ElementX/Sources/Other/MapLibre/MapLibreMapView.swift index 8e8cdfaaa..14c34f2a1 100644 --- a/ElementX/Sources/Other/MapLibre/MapLibreMapView.swift +++ b/ElementX/Sources/Other/MapLibre/MapLibreMapView.swift @@ -230,15 +230,6 @@ extension MapLibreMapView { // MARK: - MGLMapView convenient methods -private extension MGLMapView { - func removeAllAnnotations() { - guard let annotations else { - return - } - removeAnnotations(annotations) - } -} - private extension MapTilerStyle { init(_ colorScheme: ColorScheme) { switch colorScheme { diff --git a/ElementX/Sources/Other/MapLibre/MapTilerGeoCodingServiceProtocol.swift b/ElementX/Sources/Other/MapLibre/MapTilerGeoCodingServiceProtocol.swift deleted file mode 100644 index 61b0d4499..000000000 --- a/ElementX/Sources/Other/MapLibre/MapTilerGeoCodingServiceProtocol.swift +++ /dev/null @@ -1,27 +0,0 @@ -// -// Copyright 2023 New Vector Ltd -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -import CoreLocation -import Foundation - -enum MapTilerGeocodingError: Error { - case wrongGeocodingURL - case geocodingFailed -} - -protocol MapTilerGeoCodingServiceProtocol { - func reverseGeoCoding(for coordinate: CLLocationCoordinate2D) async -> Result -} diff --git a/ElementX/Sources/Other/NetworkMonitor/NetworkMonitor.swift b/ElementX/Sources/Other/NetworkMonitor/NetworkMonitor.swift index fbeee462f..ca90675aa 100644 --- a/ElementX/Sources/Other/NetworkMonitor/NetworkMonitor.swift +++ b/ElementX/Sources/Other/NetworkMonitor/NetworkMonitor.swift @@ -27,14 +27,6 @@ class NetworkMonitor: NetworkMonitorProtocol { reachabilitySubject.asCurrentValuePublisher() } - var isCurrentConnectionExpensive: Bool { - pathMonitor.currentPath.isExpensive - } - - var isCurrentConnectionConstrained: Bool { - pathMonitor.currentPath.isConstrained - } - init() { queue = DispatchQueue(label: "io.element.elementx.networkmonitor", qos: .background) pathMonitor = NWPathMonitor() diff --git a/ElementX/Sources/Other/NetworkMonitor/NetworkMonitorProtocol.swift b/ElementX/Sources/Other/NetworkMonitor/NetworkMonitorProtocol.swift index 33436f4a6..7d7fc7d08 100644 --- a/ElementX/Sources/Other/NetworkMonitor/NetworkMonitorProtocol.swift +++ b/ElementX/Sources/Other/NetworkMonitor/NetworkMonitorProtocol.swift @@ -23,8 +23,6 @@ enum NetworkMonitorReachability { protocol NetworkMonitorProtocol { var reachabilityPublisher: CurrentValuePublisher { get } - var isCurrentConnectionExpensive: Bool { get } - var isCurrentConnectionConstrained: Bool { get } } // sourcery: AutoMockable diff --git a/ElementX/Sources/Other/Pills/PillAttachmentViewProvider.swift b/ElementX/Sources/Other/Pills/PillAttachmentViewProvider.swift index ae4d75487..afa95ac00 100644 --- a/ElementX/Sources/Other/Pills/PillAttachmentViewProvider.swift +++ b/ElementX/Sources/Other/Pills/PillAttachmentViewProvider.swift @@ -80,10 +80,13 @@ final class PillAttachmentViewProvider: NSTextAttachmentViewProvider { // Fixes crashes when inserting mention pills in the composer on Mac // https://github.com/element-hq/element-x-ios/issues/2070 + // periphery:ignore - read comment above static var supportsSecureCoding = false + // periphery:ignore - read comment above func encode(with coder: NSCoder) { } + // periphery:ignore - read comment above init?(coder: NSCoder) { fatalError("Not implemented") } diff --git a/ElementX/Sources/Other/SwiftUI/Views/LoadableImage.swift b/ElementX/Sources/Other/SwiftUI/Views/LoadableImage.swift index 31439cb57..5597c73c6 100644 --- a/ElementX/Sources/Other/SwiftUI/Views/LoadableImage.swift +++ b/ElementX/Sources/Other/SwiftUI/Views/LoadableImage.swift @@ -77,8 +77,6 @@ struct LoadableImage: View { private struct LoadableImageContent: View, ImageDataProvider { private let mediaSource: MediaSourceProxy private let blurhash: String? - private let size: CGSize? - private let imageProvider: ImageProviderProtocol? private let transformer: (AnyView) -> TransformerView private let placeholder: () -> PlaceholderView @@ -92,8 +90,6 @@ private struct LoadableImageContent PlaceholderView) { self.mediaSource = mediaSource self.blurhash = blurhash - self.size = size - self.imageProvider = imageProvider self.transformer = transformer self.placeholder = placeholder _contentLoader = StateObject(wrappedValue: ContentLoader(mediaSource: mediaSource, size: size, imageProvider: imageProvider)) diff --git a/ElementX/Sources/Other/SwiftUI/Views/LocationMarkerView.swift b/ElementX/Sources/Other/SwiftUI/Views/LocationMarkerView.swift index 38c6cba9e..8cdee6199 100644 --- a/ElementX/Sources/Other/SwiftUI/Views/LocationMarkerView.swift +++ b/ElementX/Sources/Other/SwiftUI/Views/LocationMarkerView.swift @@ -18,8 +18,6 @@ import Compound import SwiftUI struct LocationMarkerView: View { - @Environment(\.dynamicTypeSize) private var dynamicTypeSize - var mode: Mode = .map enum Mode { case map, button } diff --git a/ElementX/Sources/Screens/AppLock/AppLockSetupPINScreen/View/PINTextField.swift b/ElementX/Sources/Screens/AppLock/AppLockSetupPINScreen/View/PINTextField.swift index e086a9b64..bab03a7a7 100644 --- a/ElementX/Sources/Screens/AppLock/AppLockSetupPINScreen/View/PINTextField.swift +++ b/ElementX/Sources/Screens/AppLock/AppLockSetupPINScreen/View/PINTextField.swift @@ -58,7 +58,7 @@ private struct PINTextFieldStyle: TextFieldStyle { let pinCode: String let isSecure: Bool - public func _body(configuration: TextField<_Label>) -> some View { + func _body(configuration: TextField<_Label>) -> some View { HStack(spacing: 8) { ForEach(0..<4) { index in PINDigitField(digit: digit(index)) diff --git a/ElementX/Sources/Screens/Authentication/LoginScreen/LoginMode.swift b/ElementX/Sources/Screens/Authentication/LoginScreen/LoginMode.swift index 3a7aefdc3..3ca43cf05 100644 --- a/ElementX/Sources/Screens/Authentication/LoginScreen/LoginMode.swift +++ b/ElementX/Sources/Screens/Authentication/LoginScreen/LoginMode.swift @@ -35,22 +35,4 @@ enum LoginMode: Equatable { return false } } - - var supportsPasswordFlow: Bool { - switch self { - case .password: - return true - default: - return false - } - } - - var isUnsupported: Bool { - switch self { - case .unsupported: - return true - default: - return false - } - } } diff --git a/ElementX/Sources/Screens/Authentication/LoginScreen/LoginScreenCoordinator.swift b/ElementX/Sources/Screens/Authentication/LoginScreen/LoginScreenCoordinator.swift index e34d39564..6b1c71dea 100644 --- a/ElementX/Sources/Screens/Authentication/LoginScreen/LoginScreenCoordinator.swift +++ b/ElementX/Sources/Screens/Authentication/LoginScreen/LoginScreenCoordinator.swift @@ -37,9 +37,7 @@ enum LoginScreenCoordinatorAction { final class LoginScreenCoordinator: CoordinatorProtocol { private let parameters: LoginScreenCoordinatorParameters private var viewModel: LoginScreenViewModelProtocol - - @CancellableTask private var currentTask: Task? - + private var authenticationService: AuthenticationServiceProxyProtocol { parameters.authenticationService } private let actionsSubject: PassthroughSubject = .init() diff --git a/ElementX/Sources/Screens/ComposerToolbar/View/MessageComposer.swift b/ElementX/Sources/Screens/ComposerToolbar/View/MessageComposer.swift index f904754c6..829d7338b 100644 --- a/ElementX/Sources/Screens/ComposerToolbar/View/MessageComposer.swift +++ b/ElementX/Sources/Screens/ComposerToolbar/View/MessageComposer.swift @@ -203,7 +203,6 @@ struct MessageComposer_Previews: PreviewProvider, TestablePreview { ] static func messageComposer(_ content: String = "", - sendingDisabled: Bool = false, mode: RoomScreenComposerMode = .default) -> MessageComposer { let viewModel = WysiwygComposerViewModel(minHeight: 22, maxExpandedHeight: 250) @@ -228,7 +227,7 @@ struct MessageComposer_Previews: PreviewProvider, TestablePreview { static var previews: some View { VStack(spacing: 8) { - messageComposer(sendingDisabled: true) + messageComposer() messageComposer("Some message", mode: .edit(originalItemId: .random)) diff --git a/ElementX/Sources/Screens/CreatePollScreen/PollFormScreenCoordinator.swift b/ElementX/Sources/Screens/CreatePollScreen/PollFormScreenCoordinator.swift index 7e52aa154..7fe097607 100644 --- a/ElementX/Sources/Screens/CreatePollScreen/PollFormScreenCoordinator.swift +++ b/ElementX/Sources/Screens/CreatePollScreen/PollFormScreenCoordinator.swift @@ -28,7 +28,6 @@ enum PollFormScreenCoordinatorAction { } final class PollFormScreenCoordinator: CoordinatorProtocol { - private let parameters: PollFormScreenCoordinatorParameters private var viewModel: PollFormScreenViewModelProtocol private let actionsSubject: PassthroughSubject = .init() private var cancellables = Set() @@ -38,8 +37,6 @@ final class PollFormScreenCoordinator: CoordinatorProtocol { } init(parameters: PollFormScreenCoordinatorParameters) { - self.parameters = parameters - viewModel = PollFormScreenViewModel(mode: parameters.mode) } diff --git a/ElementX/Sources/Screens/FilePreviewScreen/InteractiveQuickLook.swift b/ElementX/Sources/Screens/FilePreviewScreen/InteractiveQuickLook.swift index b2394c429..1573b557e 100644 --- a/ElementX/Sources/Screens/FilePreviewScreen/InteractiveQuickLook.swift +++ b/ElementX/Sources/Screens/FilePreviewScreen/InteractiveQuickLook.swift @@ -68,7 +68,6 @@ private struct MediaPreviewViewController: UIViewControllerRepresentable { class PreviewHostingController: UIViewController, QLPreviewControllerDataSource, QLPreviewControllerDelegate { let previewItem: MediaPreviewItem let shouldHideControls: Bool - let dismissalPublisher: PassthroughSubject let onDismiss: () -> Void private var dismissalObserver: AnyCancellable? @@ -81,7 +80,6 @@ private struct MediaPreviewViewController: UIViewControllerRepresentable { onDismiss: @escaping () -> Void) { self.previewItem = previewItem self.shouldHideControls = shouldHideControls - self.dismissalPublisher = dismissalPublisher self.onDismiss = onDismiss super.init(nibName: nil, bundle: nil) diff --git a/ElementX/Sources/Screens/HomeScreen/HomeScreenViewModel.swift b/ElementX/Sources/Screens/HomeScreen/HomeScreenViewModel.swift index 69ee38c4d..8fbf912a9 100644 --- a/ElementX/Sources/Screens/HomeScreen/HomeScreenViewModel.swift +++ b/ElementX/Sources/Screens/HomeScreen/HomeScreenViewModel.swift @@ -152,6 +152,7 @@ class HomeScreenViewModel: HomeScreenViewModelType, HomeScreenViewModelProtocol } } + // perphery: ignore - used in release mode func presentCrashedLastRunAlert() { state.bindings.alertInfo = AlertInfo(id: UUID(), title: L10n.crashDetectionDialogContent(InfoPlistReader.main.bundleDisplayName), diff --git a/ElementX/Sources/Screens/HomeScreen/HomeScreenViewModelProtocol.swift b/ElementX/Sources/Screens/HomeScreen/HomeScreenViewModelProtocol.swift index 02c6d170d..a2add2c9e 100644 --- a/ElementX/Sources/Screens/HomeScreen/HomeScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/HomeScreen/HomeScreenViewModelProtocol.swift @@ -22,5 +22,6 @@ protocol HomeScreenViewModelProtocol { var context: HomeScreenViewModelType.Context { get } + // periphery: ignore - used in release mode func presentCrashedLastRunAlert() } diff --git a/ElementX/Sources/Screens/InviteUsersScreen/InviteUsersScreenCoordinator.swift b/ElementX/Sources/Screens/InviteUsersScreen/InviteUsersScreenCoordinator.swift index efe751cfa..509f9bdff 100644 --- a/ElementX/Sources/Screens/InviteUsersScreen/InviteUsersScreenCoordinator.swift +++ b/ElementX/Sources/Screens/InviteUsersScreen/InviteUsersScreenCoordinator.swift @@ -33,7 +33,6 @@ enum InviteUsersScreenCoordinatorAction { } final class InviteUsersScreenCoordinator: CoordinatorProtocol { - private let parameters: InviteUsersScreenCoordinatorParameters private let viewModel: InviteUsersScreenViewModelProtocol private let actionsSubject: PassthroughSubject = .init() private var cancellables = Set() @@ -43,8 +42,6 @@ final class InviteUsersScreenCoordinator: CoordinatorProtocol { } init(parameters: InviteUsersScreenCoordinatorParameters) { - self.parameters = parameters - viewModel = InviteUsersScreenViewModel(selectedUsers: parameters.selectedUsers, roomType: parameters.roomType, mediaProvider: parameters.mediaProvider, diff --git a/ElementX/Sources/Screens/InviteUsersScreen/InviteUsersScreenModels.swift b/ElementX/Sources/Screens/InviteUsersScreen/InviteUsersScreenModels.swift index 92ce28a8a..e52957bb6 100644 --- a/ElementX/Sources/Screens/InviteUsersScreen/InviteUsersScreenModels.swift +++ b/ElementX/Sources/Screens/InviteUsersScreen/InviteUsersScreenModels.swift @@ -17,6 +17,7 @@ import Foundation import MatrixRustSDK +// periphery:ignore - for generic conformance enum InviteUsersScreenErrorType: Error { case unknown } diff --git a/ElementX/Sources/Screens/InviteUsersScreen/InviteUsersScreenViewModel.swift b/ElementX/Sources/Screens/InviteUsersScreen/InviteUsersScreenViewModel.swift index 375d4d260..b1f4cf680 100644 --- a/ElementX/Sources/Screens/InviteUsersScreen/InviteUsersScreenViewModel.swift +++ b/ElementX/Sources/Screens/InviteUsersScreen/InviteUsersScreenViewModel.swift @@ -22,7 +22,6 @@ typealias InviteUsersScreenViewModelType = StateStoreViewModel? diff --git a/ElementX/Sources/Screens/InvitesScreen/InvitesScreenCoordinator.swift b/ElementX/Sources/Screens/InvitesScreen/InvitesScreenCoordinator.swift index 57caa0826..fadf236c0 100644 --- a/ElementX/Sources/Screens/InvitesScreen/InvitesScreenCoordinator.swift +++ b/ElementX/Sources/Screens/InvitesScreen/InvitesScreenCoordinator.swift @@ -26,7 +26,6 @@ enum InvitesScreenCoordinatorAction { } final class InvitesScreenCoordinator: CoordinatorProtocol { - private let parameters: InvitesScreenCoordinatorParameters private var viewModel: InvitesScreenViewModelProtocol private let actionsSubject: PassthroughSubject = .init() private var cancellables = Set() @@ -36,7 +35,6 @@ final class InvitesScreenCoordinator: CoordinatorProtocol { } init(parameters: InvitesScreenCoordinatorParameters) { - self.parameters = parameters viewModel = InvitesScreenViewModel(userSession: parameters.userSession, appSettings: ServiceLocator.shared.settings, analytics: ServiceLocator.shared.analytics, diff --git a/ElementX/Sources/Screens/InvitesScreen/InvitesScreenViewModel.swift b/ElementX/Sources/Screens/InvitesScreen/InvitesScreenViewModel.swift index 6d6b10eb7..c1ba7b246 100644 --- a/ElementX/Sources/Screens/InvitesScreen/InvitesScreenViewModel.swift +++ b/ElementX/Sources/Screens/InvitesScreen/InvitesScreenViewModel.swift @@ -155,6 +155,7 @@ class InvitesScreenViewModel: InvitesScreenViewModelType, InvitesScreenViewModel } private func displayError(_ error: RoomProxyError) { + MXLog.error("Failed to accept/decline invite: \(error)") state.bindings.alertInfo = .init(id: true, title: L10n.commonError, message: L10n.errorUnknown) diff --git a/ElementX/Sources/Screens/MessageForwardingScreen/MessageForwardingScreenCoordinator.swift b/ElementX/Sources/Screens/MessageForwardingScreen/MessageForwardingScreenCoordinator.swift index 4a3745295..8dbb2ae12 100644 --- a/ElementX/Sources/Screens/MessageForwardingScreen/MessageForwardingScreenCoordinator.swift +++ b/ElementX/Sources/Screens/MessageForwardingScreen/MessageForwardingScreenCoordinator.swift @@ -29,7 +29,6 @@ enum MessageForwardingScreenCoordinatorAction { } final class MessageForwardingScreenCoordinator: CoordinatorProtocol { - private let parameters: MessageForwardingScreenCoordinatorParameters private var viewModel: MessageForwardingScreenViewModelProtocol private let actionsSubject: PassthroughSubject = .init() private var cancellables = Set() @@ -39,8 +38,6 @@ final class MessageForwardingScreenCoordinator: CoordinatorProtocol { } init(parameters: MessageForwardingScreenCoordinatorParameters) { - self.parameters = parameters - viewModel = MessageForwardingScreenViewModel(roomSummaryProvider: parameters.roomSummaryProvider, mediaProvider: parameters.mediaProvider, sourceRoomID: parameters.sourceRoomID) diff --git a/ElementX/Sources/Screens/MigrationScreen/MigrationScreenCoordinator.swift b/ElementX/Sources/Screens/MigrationScreen/MigrationScreenCoordinator.swift index afd71adb5..0cb9260cb 100644 --- a/ElementX/Sources/Screens/MigrationScreen/MigrationScreenCoordinator.swift +++ b/ElementX/Sources/Screens/MigrationScreen/MigrationScreenCoordinator.swift @@ -19,7 +19,6 @@ import SwiftUI final class MigrationScreenCoordinator: CoordinatorProtocol { private var viewModel: MigrationScreenViewModelProtocol - private var cancellables = Set() init() { viewModel = MigrationScreenViewModel() diff --git a/ElementX/Sources/Screens/MigrationScreen/MigrationScreenModels.swift b/ElementX/Sources/Screens/MigrationScreen/MigrationScreenModels.swift index 4ae20ba77..529abff3f 100644 --- a/ElementX/Sources/Screens/MigrationScreen/MigrationScreenModels.swift +++ b/ElementX/Sources/Screens/MigrationScreen/MigrationScreenModels.swift @@ -16,8 +16,6 @@ import Foundation -enum MigrationScreenViewModelAction { } - struct MigrationScreenViewState: BindableState { } enum MigrationScreenViewAction { } diff --git a/ElementX/Sources/Screens/MigrationScreen/MigrationScreenViewModel.swift b/ElementX/Sources/Screens/MigrationScreen/MigrationScreenViewModel.swift index 2dab324a1..386fe3ad5 100644 --- a/ElementX/Sources/Screens/MigrationScreen/MigrationScreenViewModel.swift +++ b/ElementX/Sources/Screens/MigrationScreen/MigrationScreenViewModel.swift @@ -20,12 +20,6 @@ import SwiftUI typealias MigrationScreenViewModelType = StateStoreViewModel class MigrationScreenViewModel: MigrationScreenViewModelType, MigrationScreenViewModelProtocol { - private var actionsSubject: PassthroughSubject = .init() - - var actions: AnyPublisher { - actionsSubject.eraseToAnyPublisher() - } - init() { super.init(initialViewState: MigrationScreenViewState()) } diff --git a/ElementX/Sources/Screens/MigrationScreen/MigrationScreenViewModelProtocol.swift b/ElementX/Sources/Screens/MigrationScreen/MigrationScreenViewModelProtocol.swift index 206c66211..447f17c0d 100644 --- a/ElementX/Sources/Screens/MigrationScreen/MigrationScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/MigrationScreen/MigrationScreenViewModelProtocol.swift @@ -18,6 +18,5 @@ import Combine @MainActor protocol MigrationScreenViewModelProtocol { - var actions: AnyPublisher { get } var context: MigrationScreenViewModelType.Context { get } } diff --git a/ElementX/Sources/Screens/OnboardingScreen/OnboardingScreenModels.swift b/ElementX/Sources/Screens/OnboardingScreen/OnboardingScreenModels.swift index d6b16f355..2395298ff 100644 --- a/ElementX/Sources/Screens/OnboardingScreen/OnboardingScreenModels.swift +++ b/ElementX/Sources/Screens/OnboardingScreen/OnboardingScreenModels.swift @@ -22,13 +22,6 @@ enum OnboardingScreenCoordinatorAction { case login } -/// The content displayed in a single screen page. -struct OnboardingScreenPageContent { - let title: AttributedString - let message: String - let image: ImageAsset -} - enum OnboardingScreenViewModelAction { case login } diff --git a/ElementX/Sources/Screens/ReportContentScreen/View/ReportContentScreen.swift b/ElementX/Sources/Screens/ReportContentScreen/View/ReportContentScreen.swift index d638a687d..ced3fbeff 100644 --- a/ElementX/Sources/Screens/ReportContentScreen/View/ReportContentScreen.swift +++ b/ElementX/Sources/Screens/ReportContentScreen/View/ReportContentScreen.swift @@ -18,13 +18,7 @@ import Compound import SwiftUI struct ReportContentScreen: View { - @Environment(\.horizontalSizeClass) private var horizontalSizeClass - @ObservedObject var context: ReportContentScreenViewModel.Context - - private var horizontalPadding: CGFloat { - horizontalSizeClass == .regular ? 50 : 16 - } var body: some View { Form { diff --git a/ElementX/Sources/Screens/RoomDetailsScreen/RoomDetailsScreenCoordinator.swift b/ElementX/Sources/Screens/RoomDetailsScreen/RoomDetailsScreenCoordinator.swift index 0fd6be78c..5c30680d7 100644 --- a/ElementX/Sources/Screens/RoomDetailsScreen/RoomDetailsScreenCoordinator.swift +++ b/ElementX/Sources/Screens/RoomDetailsScreen/RoomDetailsScreenCoordinator.swift @@ -35,7 +35,6 @@ enum RoomDetailsScreenCoordinatorAction { } final class RoomDetailsScreenCoordinator: CoordinatorProtocol { - private let parameters: RoomDetailsScreenCoordinatorParameters private var viewModel: RoomDetailsScreenViewModelProtocol private let actionsSubject: PassthroughSubject = .init() @@ -46,8 +45,6 @@ final class RoomDetailsScreenCoordinator: CoordinatorProtocol { } init(parameters: RoomDetailsScreenCoordinatorParameters) { - self.parameters = parameters - viewModel = RoomDetailsScreenViewModel(accountUserID: parameters.accountUserID, roomProxy: parameters.roomProxy, mediaProvider: parameters.mediaProvider, diff --git a/ElementX/Sources/Screens/RoomDetailsScreen/RoomDetailsScreenModels.swift b/ElementX/Sources/Screens/RoomDetailsScreen/RoomDetailsScreenModels.swift index 46d8f1b97..1b18ba880 100644 --- a/ElementX/Sources/Screens/RoomDetailsScreen/RoomDetailsScreenModels.swift +++ b/ElementX/Sources/Screens/RoomDetailsScreen/RoomDetailsScreenModels.swift @@ -219,12 +219,6 @@ extension RoomDetailsNotificationSettingsState { return false } - /// Returns `true` when the settings are loaded and `isDefault` is true. - var isDefault: Bool { - guard case let .loaded(settings) = self else { return false } - return settings.isDefault - } - /// Returns `true` when the settings are loaded and `isDefault` is false. var isCustom: Bool { guard case let .loaded(settings) = self else { return false } diff --git a/ElementX/Sources/Screens/RoomMemberDetailsScreen/RoomMemberDetailsScreenCoordinator.swift b/ElementX/Sources/Screens/RoomMemberDetailsScreen/RoomMemberDetailsScreenCoordinator.swift index a7f149f5f..53daccae4 100644 --- a/ElementX/Sources/Screens/RoomMemberDetailsScreen/RoomMemberDetailsScreenCoordinator.swift +++ b/ElementX/Sources/Screens/RoomMemberDetailsScreen/RoomMemberDetailsScreenCoordinator.swift @@ -29,7 +29,6 @@ enum RoomMemberDetailsScreenCoordinatorAction { } final class RoomMemberDetailsScreenCoordinator: CoordinatorProtocol { - private let parameters: RoomMemberDetailsScreenCoordinatorParameters private var viewModel: RoomMemberDetailsScreenViewModelProtocol private let actionsSubject: PassthroughSubject = .init() @@ -40,8 +39,6 @@ final class RoomMemberDetailsScreenCoordinator: CoordinatorProtocol { } init(parameters: RoomMemberDetailsScreenCoordinatorParameters) { - self.parameters = parameters - viewModel = RoomMemberDetailsScreenViewModel(roomProxy: parameters.roomProxy, roomMemberProxy: parameters.roomMemberProxy, mediaProvider: parameters.mediaProvider, diff --git a/ElementX/Sources/Screens/RoomMemberDetailsScreen/RoomMemberDetailsScreenModels.swift b/ElementX/Sources/Screens/RoomMemberDetailsScreen/RoomMemberDetailsScreenModels.swift index 668583363..fa24dcca1 100644 --- a/ElementX/Sources/Screens/RoomMemberDetailsScreen/RoomMemberDetailsScreenModels.swift +++ b/ElementX/Sources/Screens/RoomMemberDetailsScreen/RoomMemberDetailsScreenModels.swift @@ -83,6 +83,5 @@ enum RoomMemberDetailsScreenViewAction { } enum RoomMemberDetailsScreenError: Hashable { - case alert(String) case unknown } diff --git a/ElementX/Sources/Screens/RoomMemberListScreen/RoomMembersListScreenCoordinator.swift b/ElementX/Sources/Screens/RoomMemberListScreen/RoomMembersListScreenCoordinator.swift index b5aa5a3e4..9ef48688e 100644 --- a/ElementX/Sources/Screens/RoomMemberListScreen/RoomMembersListScreenCoordinator.swift +++ b/ElementX/Sources/Screens/RoomMemberListScreen/RoomMembersListScreenCoordinator.swift @@ -28,7 +28,6 @@ enum RoomMembersListScreenCoordinatorAction { } final class RoomMembersListScreenCoordinator: CoordinatorProtocol { - private let parameters: RoomMembersListScreenCoordinatorParameters private var viewModel: RoomMembersListScreenViewModelProtocol private let actionsSubject: PassthroughSubject = .init() @@ -39,8 +38,6 @@ final class RoomMembersListScreenCoordinator: CoordinatorProtocol { } init(parameters: RoomMembersListScreenCoordinatorParameters) { - self.parameters = parameters - viewModel = RoomMembersListScreenViewModel(roomProxy: parameters.roomProxy, mediaProvider: parameters.mediaProvider, userIndicatorController: ServiceLocator.shared.userIndicatorController) diff --git a/ElementX/Sources/Screens/RoomMemberListScreen/View/RoomMembersListScreen.swift b/ElementX/Sources/Screens/RoomMemberListScreen/View/RoomMembersListScreen.swift index de48880e0..a79ec9790 100644 --- a/ElementX/Sources/Screens/RoomMemberListScreen/View/RoomMembersListScreen.swift +++ b/ElementX/Sources/Screens/RoomMemberListScreen/View/RoomMembersListScreen.swift @@ -18,8 +18,6 @@ import Compound import SwiftUI struct RoomMembersListScreen: View { - @Environment(\.colorScheme) private var colorScheme - @ObservedObject var context: RoomMembersListScreenViewModel.Context var body: some View { diff --git a/ElementX/Sources/Screens/RoomNotificationSettingsScreen/RoomNotificationSettingsScreenCoordinator.swift b/ElementX/Sources/Screens/RoomNotificationSettingsScreen/RoomNotificationSettingsScreenCoordinator.swift index e2cb24ad3..f32bf89c1 100644 --- a/ElementX/Sources/Screens/RoomNotificationSettingsScreen/RoomNotificationSettingsScreenCoordinator.swift +++ b/ElementX/Sources/Screens/RoomNotificationSettingsScreen/RoomNotificationSettingsScreenCoordinator.swift @@ -38,10 +38,6 @@ final class RoomNotificationSettingsScreenCoordinator: CoordinatorProtocol { var actions: AnyPublisher { actionsSubject.eraseToAnyPublisher() } - - private var navigationStackCoordinator: NavigationStackCoordinator? { - parameters.navigationStackCoordinator - } init(parameters: RoomNotificationSettingsScreenCoordinatorParameters) { self.parameters = parameters diff --git a/ElementX/Sources/Screens/RoomNotificationSettingsScreen/RoomNotificationSettingsScreenModels.swift b/ElementX/Sources/Screens/RoomNotificationSettingsScreen/RoomNotificationSettingsScreenModels.swift index 2e98e9c41..2a3b105c0 100644 --- a/ElementX/Sources/Screens/RoomNotificationSettingsScreen/RoomNotificationSettingsScreenModels.swift +++ b/ElementX/Sources/Screens/RoomNotificationSettingsScreen/RoomNotificationSettingsScreenModels.swift @@ -81,7 +81,6 @@ struct RoomNotificationSettingsScreenViewState: BindableState { struct RoomNotificationSettingsScreenViewStateBindings { var allowCustomSetting = false - var customMode: RoomNotificationModeProxy = .allMessages /// Information describing the currently displayed alert. var alertInfo: AlertInfo? } diff --git a/ElementX/Sources/Screens/RoomNotificationSettingsScreen/RoomNotificationSettingsScreenViewModel.swift b/ElementX/Sources/Screens/RoomNotificationSettingsScreen/RoomNotificationSettingsScreenViewModel.swift index dbfba89d7..5290c8a21 100644 --- a/ElementX/Sources/Screens/RoomNotificationSettingsScreen/RoomNotificationSettingsScreenViewModel.swift +++ b/ElementX/Sources/Screens/RoomNotificationSettingsScreen/RoomNotificationSettingsScreenViewModel.swift @@ -24,6 +24,7 @@ class RoomNotificationSettingsScreenViewModel: RoomNotificationSettingsScreenVie private let notificationSettingsProxy: NotificationSettingsProxyProtocol private let roomProxy: RoomProxyProtocol + // periphery:ignore - cancellable tasks cancel when reassigned @CancellableTask private var fetchNotificationSettingsTask: Task? var actions: AnyPublisher { @@ -94,9 +95,6 @@ class RoomNotificationSettingsScreenViewModel: RoomNotificationSettingsScreenVie if !state.isRestoringDefaultSetting { state.bindings.allowCustomSetting = !settings.isDefault } - if state.pendingCustomMode == nil { - state.bindings.customMode = settings.mode - } } catch { state.notificationSettingsState = .error displayError(.loadingSettingsFailed) diff --git a/ElementX/Sources/Screens/RoomScreen/RoomScreenCoordinator.swift b/ElementX/Sources/Screens/RoomScreen/RoomScreenCoordinator.swift index d43125a46..476af9a21 100644 --- a/ElementX/Sources/Screens/RoomScreen/RoomScreenCoordinator.swift +++ b/ElementX/Sources/Screens/RoomScreen/RoomScreenCoordinator.swift @@ -45,7 +45,6 @@ enum RoomScreenCoordinatorAction { } final class RoomScreenCoordinator: CoordinatorProtocol { - private var parameters: RoomScreenCoordinatorParameters private var viewModel: RoomScreenViewModelProtocol private var composerViewModel: ComposerToolbarViewModel private var wysiwygViewModel: WysiwygComposerViewModel @@ -58,8 +57,6 @@ final class RoomScreenCoordinator: CoordinatorProtocol { } init(parameters: RoomScreenCoordinatorParameters) { - self.parameters = parameters - viewModel = RoomScreenViewModel(roomProxy: parameters.roomProxy, timelineController: parameters.timelineController, mediaProvider: parameters.mediaProvider, diff --git a/ElementX/Sources/Screens/RoomScreen/View/Supplementary/ReactionsSummaryView.swift b/ElementX/Sources/Screens/RoomScreen/View/Supplementary/ReactionsSummaryView.swift index 566b7dc22..4a533235b 100644 --- a/ElementX/Sources/Screens/RoomScreen/View/Supplementary/ReactionsSummaryView.swift +++ b/ElementX/Sources/Screens/RoomScreen/View/Supplementary/ReactionsSummaryView.swift @@ -23,10 +23,6 @@ struct ReactionsSummaryView: View { @State var selectedReactionKey: String - var selectedReactionIndex: Int { - reactions.firstIndex(where: { $0.key == selectedReactionKey }) ?? 0 - } - var body: some View { VStack(alignment: .leading, spacing: 0) { reactionButtons diff --git a/ElementX/Sources/Screens/RoomScreen/View/Timeline/PollRoomTimelineView.swift b/ElementX/Sources/Screens/RoomScreen/View/Timeline/PollRoomTimelineView.swift index ab8a8d965..0cd6583af 100644 --- a/ElementX/Sources/Screens/RoomScreen/View/Timeline/PollRoomTimelineView.swift +++ b/ElementX/Sources/Screens/RoomScreen/View/Timeline/PollRoomTimelineView.swift @@ -18,7 +18,6 @@ import SwiftUI struct PollRoomTimelineView: View { let timelineItem: PollRoomTimelineItem - @Environment(\.timelineStyle) var timelineStyle @EnvironmentObject private var context: RoomScreenViewModel.Context private let feedbackGenerator = UIImpactFeedbackGenerator(style: .heavy) diff --git a/ElementX/Sources/Screens/Settings/AvancedOptionsScreen/AdvancedSettingsScreenModels.swift b/ElementX/Sources/Screens/Settings/AvancedOptionsScreen/AdvancedSettingsScreenModels.swift index 09948ecec..645c78904 100644 --- a/ElementX/Sources/Screens/Settings/AvancedOptionsScreen/AdvancedSettingsScreenModels.swift +++ b/ElementX/Sources/Screens/Settings/AvancedOptionsScreen/AdvancedSettingsScreenModels.swift @@ -14,13 +14,13 @@ // limitations under the License. // -// periphery:ignore:all - subscripts lead to false positives import Foundation struct AdvancedSettingsScreenViewState: BindableState { var bindings: AdvancedSettingsScreenViewStateBindings } +// periphery:ignore - subscript are seen as false positives @dynamicMemberLookup struct AdvancedSettingsScreenViewStateBindings { private let advancedSettings: AdvancedSettingsProtocol diff --git a/ElementX/Sources/Screens/Settings/LegalInformationScreen/LegalInformationScreenModels.swift b/ElementX/Sources/Screens/Settings/LegalInformationScreen/LegalInformationScreenModels.swift index 8121b91a1..3c0f74444 100644 --- a/ElementX/Sources/Screens/Settings/LegalInformationScreen/LegalInformationScreenModels.swift +++ b/ElementX/Sources/Screens/Settings/LegalInformationScreen/LegalInformationScreenModels.swift @@ -16,6 +16,7 @@ import Foundation +// periphery:ignore - required for the architecture enum LegalInformationScreenViewModelAction { } struct LegalInformationScreenViewState: BindableState { diff --git a/ElementX/Sources/Screens/Settings/LegalInformationScreen/LegalInformationScreenViewModelProtocol.swift b/ElementX/Sources/Screens/Settings/LegalInformationScreen/LegalInformationScreenViewModelProtocol.swift index 26c963b20..d11c53945 100644 --- a/ElementX/Sources/Screens/Settings/LegalInformationScreen/LegalInformationScreenViewModelProtocol.swift +++ b/ElementX/Sources/Screens/Settings/LegalInformationScreen/LegalInformationScreenViewModelProtocol.swift @@ -16,6 +16,7 @@ import Combine +// periphery:ignore - markdown protocol @MainActor protocol LegalInformationScreenViewModelProtocol { var context: LegalInformationScreenViewModelType.Context { get } diff --git a/ElementX/Sources/Screens/Settings/NotificationSettingsEditScreen/NotificationSettingsEditScreenCoordinator.swift b/ElementX/Sources/Screens/Settings/NotificationSettingsEditScreen/NotificationSettingsEditScreenCoordinator.swift index 3af88616e..7ba042bd9 100644 --- a/ElementX/Sources/Screens/Settings/NotificationSettingsEditScreen/NotificationSettingsEditScreenCoordinator.swift +++ b/ElementX/Sources/Screens/Settings/NotificationSettingsEditScreen/NotificationSettingsEditScreenCoordinator.swift @@ -24,18 +24,11 @@ struct NotificationSettingsEditScreenCoordinatorParameters { let notificationSettings: NotificationSettingsProxyProtocol } -enum NotificationSettingsEditScreenCoordinatorAction { } - final class NotificationSettingsEditScreenCoordinator: CoordinatorProtocol { private let parameters: NotificationSettingsEditScreenCoordinatorParameters private var viewModel: NotificationSettingsEditScreenViewModelProtocol - private let actionsSubject: PassthroughSubject = .init() private var cancellables = Set() - var actions: AnyPublisher { - actionsSubject.eraseToAnyPublisher() - } - init(parameters: NotificationSettingsEditScreenCoordinatorParameters) { self.parameters = parameters diff --git a/ElementX/Sources/Screens/Settings/NotificationSettingsEditScreen/NotificationSettingsEditScreenModels.swift b/ElementX/Sources/Screens/Settings/NotificationSettingsEditScreen/NotificationSettingsEditScreenModels.swift index ad0edae7e..af095ff71 100644 --- a/ElementX/Sources/Screens/Settings/NotificationSettingsEditScreen/NotificationSettingsEditScreenModels.swift +++ b/ElementX/Sources/Screens/Settings/NotificationSettingsEditScreen/NotificationSettingsEditScreenModels.swift @@ -53,7 +53,6 @@ struct NotificationSettingsEditScreenViewState: BindableState { } struct NotificationSettingsEditScreenViewStateBindings { - var searchQuery = "" var alertInfo: AlertInfo? } @@ -103,8 +102,6 @@ struct NotificationSettingsEditScreenStrings { } struct NotificationSettingsEditScreenRoom: Identifiable, Equatable { - static let placeholderLastMessage = AttributedString("Hidden last message") - /// The list item identifier can be a real room identifier, a custom one for invalidated entries /// or a completely unique one for empty items and skeletons let id: String @@ -117,13 +114,4 @@ struct NotificationSettingsEditScreenRoom: Identifiable, Equatable { var avatarURL: URL? var notificationMode: RoomNotificationModeProxy? - - var isPlaceholder = false - - static func placeholder() -> NotificationSettingsEditScreenRoom { - NotificationSettingsEditScreenRoom(id: UUID().uuidString, - roomId: nil, - name: "Placeholder room name", - isPlaceholder: true) - } } diff --git a/ElementX/Sources/Screens/Settings/NotificationSettingsEditScreen/NotificationSettingsEditScreenViewModel.swift b/ElementX/Sources/Screens/Settings/NotificationSettingsEditScreen/NotificationSettingsEditScreenViewModel.swift index e7a0b2c6b..804d099e1 100644 --- a/ElementX/Sources/Screens/Settings/NotificationSettingsEditScreen/NotificationSettingsEditScreenViewModel.swift +++ b/ElementX/Sources/Screens/Settings/NotificationSettingsEditScreen/NotificationSettingsEditScreenViewModel.swift @@ -26,7 +26,9 @@ class NotificationSettingsEditScreenViewModel: NotificationSettingsEditScreenVie private let userSession: UserSessionProtocol private let roomSummaryProvider: RoomSummaryProviderProtocol? + // periphery:ignore - cancellable tasks get cancelled when reassigned @CancellableTask private var fetchDefaultRoomNotificationModesTask: Task? + // periphery:ignore - cancellable tasks get cancelled when reassigned @CancellableTask private var updateRoomsWithUserDefinedModeTask: Task? var actions: AnyPublisher { diff --git a/ElementX/Sources/Screens/Settings/NotificationSettingsEditScreen/View/NotificationSettingsEditScreen.swift b/ElementX/Sources/Screens/Settings/NotificationSettingsEditScreen/View/NotificationSettingsEditScreen.swift index f10c382e3..48e765725 100644 --- a/ElementX/Sources/Screens/Settings/NotificationSettingsEditScreen/View/NotificationSettingsEditScreen.swift +++ b/ElementX/Sources/Screens/Settings/NotificationSettingsEditScreen/View/NotificationSettingsEditScreen.swift @@ -19,7 +19,6 @@ import SwiftUI struct NotificationSettingsEditScreen: View { @ObservedObject var context: NotificationSettingsEditScreenViewModel.Context - @State var isSearching = false var body: some View { Form { diff --git a/ElementX/Sources/Screens/Settings/NotificationSettingsScreen/NotificationSettingsScreenCoordinator.swift b/ElementX/Sources/Screens/Settings/NotificationSettingsScreen/NotificationSettingsScreenCoordinator.swift index 6107a5bc3..01d1c94e4 100644 --- a/ElementX/Sources/Screens/Settings/NotificationSettingsScreen/NotificationSettingsScreenCoordinator.swift +++ b/ElementX/Sources/Screens/Settings/NotificationSettingsScreen/NotificationSettingsScreenCoordinator.swift @@ -46,8 +46,7 @@ final class NotificationSettingsScreenCoordinator: CoordinatorProtocol { init(parameters: NotificationSettingsScreenCoordinatorParameters) { self.parameters = parameters - viewModel = NotificationSettingsScreenViewModel(userSession: parameters.userSession, - appSettings: ServiceLocator.shared.settings, + viewModel = NotificationSettingsScreenViewModel(appSettings: ServiceLocator.shared.settings, userNotificationCenter: parameters.userNotificationCenter, notificationSettingsProxy: parameters.notificationSettings, isModallyPresented: parameters.isModallyPresented) diff --git a/ElementX/Sources/Screens/Settings/NotificationSettingsScreen/NotificationSettingsScreenModels.swift b/ElementX/Sources/Screens/Settings/NotificationSettingsScreen/NotificationSettingsScreenModels.swift index 7000ded5b..89ad7e5b7 100644 --- a/ElementX/Sources/Screens/Settings/NotificationSettingsScreen/NotificationSettingsScreenModels.swift +++ b/ElementX/Sources/Screens/Settings/NotificationSettingsScreen/NotificationSettingsScreenModels.swift @@ -27,7 +27,6 @@ struct NotificationSettingsScreenViewState: BindableState { var strings = NotificationSettingsScreenStrings() let isModallyPresented: Bool var isUserPermissionGranted: Bool? - var allowedNotificationModes: [RoomNotificationModeProxy] = [.allMessages, .mentionsAndKeywordsOnly] var fixingConfigurationMismatch = false // Hide calls settings until calls are available in El-X let showCallsSettings = false diff --git a/ElementX/Sources/Screens/Settings/NotificationSettingsScreen/NotificationSettingsScreenViewModel.swift b/ElementX/Sources/Screens/Settings/NotificationSettingsScreen/NotificationSettingsScreenViewModel.swift index 29a0d63e9..bfbe615f3 100644 --- a/ElementX/Sources/Screens/Settings/NotificationSettingsScreen/NotificationSettingsScreenViewModel.swift +++ b/ElementX/Sources/Screens/Settings/NotificationSettingsScreen/NotificationSettingsScreenViewModel.swift @@ -24,15 +24,14 @@ class NotificationSettingsScreenViewModel: NotificationSettingsScreenViewModelTy private let appSettings: AppSettings private let userNotificationCenter: UserNotificationCenterProtocol private let notificationSettingsProxy: NotificationSettingsProxyProtocol - private let userSession: UserSessionProtocol + // periphery:ignore - cancellable tasks get cancelled when reassigned @CancellableTask private var fetchSettingsTask: Task? var actions: AnyPublisher { actionsSubject.eraseToAnyPublisher() } - init(userSession: UserSessionProtocol, appSettings: AppSettings, userNotificationCenter: UserNotificationCenterProtocol, notificationSettingsProxy: NotificationSettingsProxyProtocol, isModallyPresented: Bool) { - self.userSession = userSession + init(appSettings: AppSettings, userNotificationCenter: UserNotificationCenterProtocol, notificationSettingsProxy: NotificationSettingsProxyProtocol, isModallyPresented: Bool) { self.appSettings = appSettings self.userNotificationCenter = userNotificationCenter self.notificationSettingsProxy = notificationSettingsProxy diff --git a/ElementX/Sources/Screens/Settings/NotificationSettingsScreen/View/NotificationSettingsScreen.swift b/ElementX/Sources/Screens/Settings/NotificationSettingsScreen/View/NotificationSettingsScreen.swift index 50148c723..16a723065 100644 --- a/ElementX/Sources/Screens/Settings/NotificationSettingsScreen/View/NotificationSettingsScreen.swift +++ b/ElementX/Sources/Screens/Settings/NotificationSettingsScreen/View/NotificationSettingsScreen.swift @@ -220,8 +220,7 @@ struct NotificationSettingsScreen_Previews: PreviewProvider, TestablePreview { let userSession = MockUserSession(clientProxy: MockClientProxy(userID: "John Doe"), mediaProvider: MockMediaProvider(), voiceMessageMediaManager: VoiceMessageMediaManagerMock()) - var viewModel = NotificationSettingsScreenViewModel(userSession: userSession, - appSettings: appSettings, + var viewModel = NotificationSettingsScreenViewModel(appSettings: appSettings, userNotificationCenter: notificationCenter, notificationSettingsProxy: notificationSettingsProxy, isModallyPresented: true) @@ -249,8 +248,7 @@ struct NotificationSettingsScreen_Previews: PreviewProvider, TestablePreview { let userSession = MockUserSession(clientProxy: MockClientProxy(userID: "John Doe"), mediaProvider: MockMediaProvider(), voiceMessageMediaManager: VoiceMessageMediaManagerMock()) - var viewModel = NotificationSettingsScreenViewModel(userSession: userSession, - appSettings: appSettings, + var viewModel = NotificationSettingsScreenViewModel(appSettings: appSettings, userNotificationCenter: notificationCenter, notificationSettingsProxy: notificationSettingsProxy, isModallyPresented: true) diff --git a/ElementX/Sources/Services/Analytics/PostHogAnalyticsClient.swift b/ElementX/Sources/Services/Analytics/PostHogAnalyticsClient.swift index bf8e0870e..84c410739 100644 --- a/ElementX/Sources/Services/Analytics/PostHogAnalyticsClient.swift +++ b/ElementX/Sources/Services/Analytics/PostHogAnalyticsClient.swift @@ -50,10 +50,6 @@ class PostHogAnalyticsClient: AnalyticsClientProtocol { // it. Keep it around to avoid having multiple instances if the user re-enables } - func flush() { - postHog?.flush() - } - func capture(_ event: AnalyticsEventProtocol) { guard isRunning else { return } postHog?.capture(event.eventName, properties: attachUserProperties(to: event.properties)) diff --git a/ElementX/Sources/Services/Keychain/KeychainControllerProtocol.swift b/ElementX/Sources/Services/Keychain/KeychainControllerProtocol.swift index 280c3a5fb..c90fd55c0 100644 --- a/ElementX/Sources/Services/Keychain/KeychainControllerProtocol.swift +++ b/ElementX/Sources/Services/Keychain/KeychainControllerProtocol.swift @@ -27,15 +27,12 @@ protocol KeychainControllerProtocol: ClientSessionDelegate { // MARK: Restoration Tokens func setRestorationToken(_ restorationToken: RestorationToken, forUsername: String) - func restorationTokenForUsername(_ username: String) -> RestorationToken? func restorationTokens() -> [KeychainCredentials] func removeRestorationTokenForUsername(_ username: String) func removeAllRestorationTokens() // MARK: App Secrets - /// Removes everything from the keychain excluding any restoration tokens. - func resetSecrets() /// Whether or not an App Lock PIN code has been set. func containsPINCode() throws -> Bool /// Sets a new PIN code for App Lock. diff --git a/ElementX/Sources/Services/Media/MediaUploadingPreprocessor.swift b/ElementX/Sources/Services/Media/MediaUploadingPreprocessor.swift index 80fabe363..f6140936b 100644 --- a/ElementX/Sources/Services/Media/MediaUploadingPreprocessor.swift +++ b/ElementX/Sources/Services/Media/MediaUploadingPreprocessor.swift @@ -25,7 +25,6 @@ indirect enum MediaUploadingPreprocessorError: Error { case failedProcessingImage(MediaUploadingPreprocessorError) case failedProcessingVideo(MediaUploadingPreprocessorError) case failedProcessingAudio - case failedProcessingFile case failedGeneratingVideoThumbnail(Error?) case failedGeneratingImageThumbnail(Error?) diff --git a/ElementX/Sources/Services/Media/Provider/ImageProviderProtocol.swift b/ElementX/Sources/Services/Media/Provider/ImageProviderProtocol.swift index 578e83039..345726106 100644 --- a/ElementX/Sources/Services/Media/Provider/ImageProviderProtocol.swift +++ b/ElementX/Sources/Services/Media/Provider/ImageProviderProtocol.swift @@ -28,8 +28,4 @@ extension ImageProviderProtocol { func imageFromSource(_ source: MediaSourceProxy?) -> UIImage? { imageFromSource(source, size: nil) } - - func loadImageFromSource(_ source: MediaSourceProxy) async -> Result { - await loadImageFromSource(source, size: nil) - } } diff --git a/ElementX/Sources/Services/Media/Provider/MediaLoaderProtocol.swift b/ElementX/Sources/Services/Media/Provider/MediaLoaderProtocol.swift index df57bac30..a620c1975 100644 --- a/ElementX/Sources/Services/Media/Provider/MediaLoaderProtocol.swift +++ b/ElementX/Sources/Services/Media/Provider/MediaLoaderProtocol.swift @@ -23,9 +23,3 @@ protocol MediaLoaderProtocol { func loadMediaFileForSource(_ source: MediaSourceProxy, body: String?) async throws -> MediaFileHandleProxy } - -extension MediaLoaderProtocol { - func loadMediaFileForSource(_ source: MediaSourceProxy) async throws -> MediaFileHandleProxy { - try await loadMediaFileForSource(source, body: nil) - } -} diff --git a/ElementX/Sources/Services/Media/Provider/MediaSourceProxy.swift b/ElementX/Sources/Services/Media/Provider/MediaSourceProxy.swift index 17cc69399..9c47b2e96 100644 --- a/ElementX/Sources/Services/Media/Provider/MediaSourceProxy.swift +++ b/ElementX/Sources/Services/Media/Provider/MediaSourceProxy.swift @@ -40,11 +40,11 @@ struct MediaSourceProxy: Hashable { // MARK: - Hashable - public static func == (lhs: MediaSourceProxy, rhs: MediaSourceProxy) -> Bool { + static func == (lhs: MediaSourceProxy, rhs: MediaSourceProxy) -> Bool { lhs.url == rhs.url } - public func hash(into hasher: inout Hasher) { + func hash(into hasher: inout Hasher) { hasher.combine(url) } } diff --git a/ElementX/Sources/Services/Notification/NotificationConstants.swift b/ElementX/Sources/Services/Notification/NotificationConstants.swift index 579d6cbe1..b51d0db31 100644 --- a/ElementX/Sources/Services/Notification/NotificationConstants.swift +++ b/ElementX/Sources/Services/Notification/NotificationConstants.swift @@ -23,7 +23,6 @@ enum NotificationConstants { static let unreadCount = "unread_count" static let pusherNotificationClientIdentifier = "pusher_notification_client_identifier" static let receiverIdentifier = "receiver_id" - static let notificationIdentifier = "notification_identifier" } enum Category { diff --git a/ElementX/Sources/Services/Notification/Proxy/NotificationItemProxy.swift b/ElementX/Sources/Services/Notification/Proxy/NotificationItemProxy.swift index bad0fa8a7..7b9c2b16c 100644 --- a/ElementX/Sources/Services/Notification/Proxy/NotificationItemProxy.swift +++ b/ElementX/Sources/Services/Notification/Proxy/NotificationItemProxy.swift @@ -45,10 +45,6 @@ struct NotificationItemProxy: NotificationItemProxyProtocol { notificationItem.roomInfo.displayName } - var roomCanonicalAlias: String? { - notificationItem.roomInfo.canonicalAlias - } - var isRoomDirect: Bool { notificationItem.roomInfo.isDirect } @@ -96,27 +92,17 @@ struct EmptyNotificationItemProxy: NotificationItemProxyProtocol { var senderID: String { "" } var senderDisplayName: String? { nil } - - var senderAvatarURL: String? { nil } - + var roomDisplayName: String { "" } - var roomCanonicalAlias: String? { nil } - - var roomAvatarURL: String? { nil } - var isNoisy: Bool { false } var isRoomDirect: Bool { false } - var isRoomEncrypted: Bool? { nil } - var senderAvatarMediaSource: MediaSourceProxy? { nil } var roomAvatarMediaSource: MediaSourceProxy? { nil } - var notificationIdentifier: String { "" } - var roomJoinedMembers: Int { 0 } var hasMention: Bool { false } diff --git a/ElementX/Sources/Services/Notification/Proxy/NotificationItemProxyProtocol.swift b/ElementX/Sources/Services/Notification/Proxy/NotificationItemProxyProtocol.swift index 20149a653..701dc34f3 100644 --- a/ElementX/Sources/Services/Notification/Proxy/NotificationItemProxyProtocol.swift +++ b/ElementX/Sources/Services/Notification/Proxy/NotificationItemProxyProtocol.swift @@ -35,8 +35,6 @@ protocol NotificationItemProxyProtocol { var roomDisplayName: String { get } - var roomCanonicalAlias: String? { get } - var roomAvatarMediaSource: MediaSourceProxy? { get } var roomJoinedMembers: Int { get } diff --git a/ElementX/Sources/Services/NotificationSettings/NotificationSettingsProxy.swift b/ElementX/Sources/Services/NotificationSettings/NotificationSettingsProxy.swift index f5ec28b10..065c47597 100644 --- a/ElementX/Sources/Services/NotificationSettings/NotificationSettingsProxy.swift +++ b/ElementX/Sources/Services/NotificationSettings/NotificationSettingsProxy.swift @@ -92,10 +92,6 @@ final class NotificationSettingsProxy: NotificationSettingsProxyProtocol { try await notificationSettings.restoreDefaultRoomNotificationMode(roomId: roomId) await updatedSettings() } - - func containsKeywordsRules() async -> Bool { - await notificationSettings.containsKeywordsRules() - } func unmuteRoom(roomId: String, isEncrypted: Bool, isOneToOne: Bool) async throws { let backgroundTask = await backgroundTaskService?.startBackgroundTask(withName: "unmuteRoom") @@ -117,18 +113,6 @@ final class NotificationSettingsProxy: NotificationSettingsProxyProtocol { await updatedSettings() } - func isUserMentionEnabled() async throws -> Bool { - try await notificationSettings.isUserMentionEnabled() - } - - func setUserMentionEnabled(enabled: Bool) async throws { - let backgroundTask = await backgroundTaskService?.startBackgroundTask(withName: "setUserMentionEnabled") - defer { backgroundTask?.stop() } - - try await notificationSettings.setUserMentionEnabled(enabled: enabled) - await updatedSettings() - } - func isCallEnabled() async throws -> Bool { try await notificationSettings.isCallEnabled() } diff --git a/ElementX/Sources/Services/NotificationSettings/NotificationSettingsProxyProtocol.swift b/ElementX/Sources/Services/NotificationSettings/NotificationSettingsProxyProtocol.swift index cc270815c..bb3e4e824 100644 --- a/ElementX/Sources/Services/NotificationSettings/NotificationSettingsProxyProtocol.swift +++ b/ElementX/Sources/Services/NotificationSettings/NotificationSettingsProxyProtocol.swift @@ -32,12 +32,9 @@ protocol NotificationSettingsProxyProtocol { func getDefaultRoomNotificationMode(isEncrypted: Bool, isOneToOne: Bool) async -> RoomNotificationModeProxy func setDefaultRoomNotificationMode(isEncrypted: Bool, isOneToOne: Bool, mode: RoomNotificationModeProxy) async throws func restoreDefaultNotificationMode(roomId: String) async throws - func containsKeywordsRules() async -> Bool func unmuteRoom(roomId: String, isEncrypted: Bool, isOneToOne: Bool) async throws func isRoomMentionEnabled() async throws -> Bool func setRoomMentionEnabled(enabled: Bool) async throws - func isUserMentionEnabled() async throws -> Bool - func setUserMentionEnabled(enabled: Bool) async throws func isCallEnabled() async throws -> Bool func setCallEnabled(enabled: Bool) async throws func isInviteForMeEnabled() async throws -> Bool diff --git a/ElementX/Sources/Services/Room/RoomMember/RoomMemberProxy.swift b/ElementX/Sources/Services/Room/RoomMember/RoomMemberProxy.swift index fb2c0fc25..341026e1f 100644 --- a/ElementX/Sources/Services/Room/RoomMember/RoomMemberProxy.swift +++ b/ElementX/Sources/Services/Room/RoomMember/RoomMemberProxy.swift @@ -39,12 +39,6 @@ final class RoomMemberProxy: RoomMemberProxyProtocol { lazy var membership = member.membership() - lazy var isNameAmbiguous = member.isNameAmbiguous() - - lazy var powerLevel = Int(member.powerLevel()) - - lazy var normalizedPowerLevel = Int(member.normalizedPowerLevel()) - lazy var isAccountOwner = member.isAccountUser() lazy var isIgnored = member.isIgnored() diff --git a/ElementX/Sources/Services/Room/RoomMember/RoomMemberProxyProtocol.swift b/ElementX/Sources/Services/Room/RoomMember/RoomMemberProxyProtocol.swift index e095b4e9b..e74c87977 100644 --- a/ElementX/Sources/Services/Room/RoomMember/RoomMemberProxyProtocol.swift +++ b/ElementX/Sources/Services/Room/RoomMember/RoomMemberProxyProtocol.swift @@ -28,9 +28,6 @@ protocol RoomMemberProxyProtocol: AnyObject { var displayName: String? { get } var avatarURL: URL? { get } var membership: MembershipState { get } - var isNameAmbiguous: Bool { get } - var powerLevel: Int { get } - var normalizedPowerLevel: Int { get } var isAccountOwner: Bool { get } var isIgnored: Bool { get } var canInviteUsers: Bool { get } diff --git a/ElementX/Sources/Services/Room/RoomProxy.swift b/ElementX/Sources/Services/Room/RoomProxy.swift index 0a095982d..19776195b 100644 --- a/ElementX/Sources/Services/Room/RoomProxy.swift +++ b/ElementX/Sources/Services/Room/RoomProxy.swift @@ -34,6 +34,7 @@ class RoomProxy: RoomProxyProtocol { private var sendMessageBackgroundTask: BackgroundTaskProtocol? private(set) var displayName: String? + // periphery:ignore - required for instance retention in the rust codebase private var roomInfoObservationToken: TaskHandle? private var subscribedForUpdates = false @@ -104,10 +105,6 @@ class RoomProxy: RoomProxyProtocol { room.topic() } - var isJoined: Bool { - room.membership() == .joined - } - var membership: Membership { room.membership() } @@ -128,10 +125,6 @@ class RoomProxy: RoomProxyProtocol { (try? room.isEncrypted()) ?? false } - var isTombstoned: Bool { - room.isTombstoned() - } - var hasOngoingCall: Bool { room.hasActiveRoomCall() } @@ -140,10 +133,6 @@ class RoomProxy: RoomProxyProtocol { room.canonicalAlias() } - var alternativeAliases: [String] { - room.alternativeAliases() - } - var hasUnreadNotifications: Bool { roomListItem.hasUnreadNotifications() } @@ -163,36 +152,6 @@ class RoomProxy: RoomProxyProtocol { var activeMembersCount: Int { Int(room.activeMembersCount()) } - - func loadAvatarURLForUserId(_ userId: String) async -> Result { - do { - guard let urlString = try await Task.dispatch(on: lowPriorityDispatchQueue, { - try self.room.memberAvatarUrl(userId: userId) - }) else { - return .success(nil) - } - - guard let avatarURL = URL(string: urlString) else { - MXLog.error("Invalid avatar URL string: \(String(describing: urlString))") - return .failure(.failedRetrievingMemberAvatarURL) - } - - return .success(avatarURL) - } catch { - return .failure(.failedRetrievingMemberAvatarURL) - } - } - - func loadDisplayNameForUserId(_ userId: String) async -> Result { - do { - let displayName = try await Task.dispatch(on: lowPriorityDispatchQueue) { - try self.room.memberDisplayName(userId: userId) - } - return .success(displayName) - } catch { - return .failure(.failedRetrievingMemberDisplayName) - } - } func redact(_ eventID: String) async -> Result { sendMessageBackgroundTask = await backgroundTaskService.startBackgroundTask(withName: backgroundTaskName, isReusable: true) @@ -290,16 +249,6 @@ class RoomProxy: RoomProxyProtocol { } } - func inviter() async -> RoomMemberProxyProtocol? { - let inviter = await Task.dispatch(on: .global()) { - self.room.inviter() - } - - return inviter.map { - RoomMemberProxy(member: $0, backgroundTaskService: self.backgroundTaskService) - } - } - func rejectInvitation() async -> Result { await Task.dispatch(on: .global()) { do { diff --git a/ElementX/Sources/Services/Room/RoomProxyProtocol.swift b/ElementX/Sources/Services/Room/RoomProxyProtocol.swift index f5ff66b1a..321edf918 100644 --- a/ElementX/Sources/Services/Room/RoomProxyProtocol.swift +++ b/ElementX/Sources/Services/Room/RoomProxyProtocol.swift @@ -19,8 +19,6 @@ import Foundation import MatrixRustSDK enum RoomProxyError: Error, Equatable { - case failedRetrievingMemberAvatarURL - case failedRetrievingMemberDisplayName case failedRedactingEvent case failedReportingContent case failedRetrievingMember @@ -46,11 +44,9 @@ protocol RoomProxyProtocol { var isPublic: Bool { get } var isSpace: Bool { get } var isEncrypted: Bool { get } - var isTombstoned: Bool { get } var membership: Membership { get } var hasOngoingCall: Bool { get } var canonicalAlias: String? { get } - var alternativeAliases: [String] { get } var hasUnreadNotifications: Bool { get } var ownUserID: String { get } @@ -62,9 +58,7 @@ protocol RoomProxyProtocol { var avatarURL: URL? { get } var members: CurrentValuePublisher<[RoomMemberProxyProtocol], Never> { get } - - var invitedMembersCount: Int { get } - + var joinedMembersCount: Int { get } var activeMembersCount: Int { get } @@ -73,14 +67,7 @@ protocol RoomProxyProtocol { var timeline: TimelineProxyProtocol { get } - /// A timeline providing just polls related events - var pollHistoryTimeline: TimelineProxyProtocol { get } - func subscribeForUpdates() async - - func loadAvatarURLForUserId(_ userId: String) async -> Result - - func loadDisplayNameForUserId(_ userId: String) async -> Result func redact(_ eventID: String) async -> Result @@ -93,8 +80,6 @@ protocol RoomProxyProtocol { func updateMembers() async func getMember(userID: String) async -> Result - - func inviter() async -> RoomMemberProxyProtocol? func rejectInvitation() async -> Result diff --git a/ElementX/Sources/Services/Room/RoomSummary/RoomEventStringBuilder.swift b/ElementX/Sources/Services/Room/RoomSummary/RoomEventStringBuilder.swift index 7aa20eed8..eabefa92d 100644 --- a/ElementX/Sources/Services/Room/RoomSummary/RoomEventStringBuilder.swift +++ b/ElementX/Sources/Services/Room/RoomSummary/RoomEventStringBuilder.swift @@ -48,9 +48,9 @@ struct RoomEventStringBuilder { let messageType = messageContent.msgtype() return messageEventStringBuilder.buildAttributedString(for: messageType, senderDisplayName: senderDisplayName, prefixWithSenderName: true) - case .state(let stateKey, let state): + case .state(_, let state): return stateEventStringBuilder - .buildString(for: state, stateKey: stateKey, sender: sender, isOutgoing: isOutgoing) + .buildString(for: state, sender: sender, isOutgoing: isOutgoing) .map(AttributedString.init) case .roomMembership(let userID, let change): return stateEventStringBuilder diff --git a/ElementX/Sources/Services/Timeline/IntentionalMentions.swift b/ElementX/Sources/Services/Timeline/IntentionalMentions.swift index e923607b2..36a9458f4 100644 --- a/ElementX/Sources/Services/Timeline/IntentionalMentions.swift +++ b/ElementX/Sources/Services/Timeline/IntentionalMentions.swift @@ -22,10 +22,6 @@ import WysiwygComposer struct IntentionalMentions: Equatable { let userIDs: Set let atRoom: Bool - - static var empty: Self { - IntentionalMentions(userIDs: [], atRoom: false) - } } extension IntentionalMentions { diff --git a/ElementX/Sources/Services/Timeline/TimelineController/MockRoomTimelineController.swift b/ElementX/Sources/Services/Timeline/TimelineController/MockRoomTimelineController.swift index c8651aa62..fa0cc23b9 100644 --- a/ElementX/Sources/Services/Timeline/TimelineController/MockRoomTimelineController.swift +++ b/ElementX/Sources/Services/Timeline/TimelineController/MockRoomTimelineController.swift @@ -14,15 +14,14 @@ // limitations under the License. // +// periphery:ignore:all + import Combine import Foundation class MockRoomTimelineController: RoomTimelineControllerProtocol { /// An array of timeline item arrays that will be inserted in order for each back pagination request. var backPaginationResponses: [[RoomTimelineItemProtocol]] = [] - /// The time delay added to each back pagination request. - var backPaginationDelay: Duration = .milliseconds(500) - /// An array of timeline items that will be appended in order when ``simulateIncomingItems()`` is called. var incomingItems: [RoomTimelineItemProtocol] = [] diff --git a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/LocationRoomTimelineItemContent.swift b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/LocationRoomTimelineItemContent.swift index b46e31f3e..df95d316f 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/LocationRoomTimelineItemContent.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/LocationRoomTimelineItemContent.swift @@ -18,23 +18,12 @@ struct LocationRoomTimelineItemContent: Hashable { let body: String let geoURI: GeoURI? let description: String? - let zoomLevel: UInt8? - let asset: AssetType? - - enum AssetType { - case sender - case pin - } init(body: String, geoURI: GeoURI? = nil, - description: String? = nil, - zoomLevel: UInt8? = nil, - asset: AssetType? = nil) { + description: String? = nil) { self.body = body self.geoURI = geoURI self.description = description - self.zoomLevel = zoomLevel - self.asset = asset } } diff --git a/ElementX/Sources/Services/Timeline/TimelineItems/RoomStateEventStringBuilder.swift b/ElementX/Sources/Services/Timeline/TimelineItems/RoomStateEventStringBuilder.swift index 22e87f493..a7f53400c 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItems/RoomStateEventStringBuilder.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItems/RoomStateEventStringBuilder.swift @@ -121,7 +121,7 @@ struct RoomStateEventStringBuilder { } } - func buildString(for state: OtherState, stateKey: String?, sender: TimelineItemSender, isOutgoing: Bool) -> String? { + func buildString(for state: OtherState, sender: TimelineItemSender, isOutgoing: Bool) -> String? { let senderName = sender.displayName ?? sender.id switch state { diff --git a/ElementX/Sources/Services/Timeline/TimelineItems/RoomTimelineItemFactory.swift b/ElementX/Sources/Services/Timeline/TimelineItems/RoomTimelineItemFactory.swift index 9baca005f..b1959aa08 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItems/RoomTimelineItemFactory.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItems/RoomTimelineItemFactory.swift @@ -526,9 +526,7 @@ struct RoomTimelineItemFactory: RoomTimelineItemFactoryProtocol { private func buildLocationTimelineItemContent(_ locationContent: LocationContent) -> LocationRoomTimelineItemContent { LocationRoomTimelineItemContent(body: locationContent.body, geoURI: .init(string: locationContent.geoUri), - description: locationContent.description, - zoomLevel: locationContent.zoomLevel, - asset: locationContent.asset.map { .init(assetType: $0) }) + description: locationContent.description) } private func buildFileTimelineItemContent(_ messageContent: FileMessageContent) -> FileRoomTimelineItemContent { @@ -568,7 +566,7 @@ struct RoomTimelineItemFactory: RoomTimelineItemFactoryProtocol { state: OtherState, stateKey: String, isOutgoing: Bool) -> RoomTimelineItemProtocol? { - guard let text = stateEventStringBuilder.buildString(for: state, stateKey: stateKey, sender: eventItemProxy.sender, isOutgoing: isOutgoing) else { return nil } + guard let text = stateEventStringBuilder.buildString(for: state, sender: eventItemProxy.sender, isOutgoing: isOutgoing) else { return nil } return buildStateTimelineItem(for: eventItemProxy, text: text, isOutgoing: isOutgoing) } @@ -680,17 +678,6 @@ struct RoomTimelineItemFactory: RoomTimelineItemFactoryProtocol { } } -private extension LocationRoomTimelineItemContent.AssetType { - init(assetType: MatrixRustSDK.AssetType) { - switch assetType { - case .sender: - self = .sender - case .pin: - self = .pin - } - } -} - extension Poll.Kind { init(pollKind: MatrixRustSDK.PollKind) { switch pollKind { diff --git a/ElementX/Sources/UITests/UITestsAppCoordinator.swift b/ElementX/Sources/UITests/UITestsAppCoordinator.swift index 2d895a103..f109f304a 100644 --- a/ElementX/Sources/UITests/UITestsAppCoordinator.swift +++ b/ElementX/Sources/UITests/UITestsAppCoordinator.swift @@ -786,8 +786,8 @@ class MockScreen: Identifiable { ServiceLocator.shared.settings.seenInvites = Set([RoomSummary].mockInvites.dropFirst(1).compactMap(\.id)) let navigationStackCoordinator = NavigationStackCoordinator() let clientProxy = MockClientProxy(userID: "@mock:client.com") - clientProxy.roomForIdentifierMocks["someAwesomeRoomId1"] = .init(with: .init(displayName: "First room", inviter: .mockCharlie)) - clientProxy.roomForIdentifierMocks["someAwesomeRoomId2"] = .init(with: .init(displayName: "Second room", inviter: .mockCharlie)) + clientProxy.roomForIdentifierMocks["someAwesomeRoomId1"] = .init(with: .init(displayName: "First room")) + clientProxy.roomForIdentifierMocks["someAwesomeRoomId2"] = .init(with: .init(displayName: "Second room")) let summaryProvider = MockRoomSummaryProvider(state: .loaded(.mockInvites)) clientProxy.inviteSummaryProvider = summaryProvider @@ -798,8 +798,8 @@ class MockScreen: Identifiable { ServiceLocator.shared.settings.seenInvites = Set([RoomSummary].mockInvites.compactMap(\.id)) let navigationStackCoordinator = NavigationStackCoordinator() let clientProxy = MockClientProxy(userID: "@mock:client.com") - clientProxy.roomForIdentifierMocks["someAwesomeRoomId1"] = .init(with: .init(displayName: "First room", inviter: .mockCharlie)) - clientProxy.roomForIdentifierMocks["someAwesomeRoomId2"] = .init(with: .init(displayName: "Second room", inviter: .mockCharlie)) + clientProxy.roomForIdentifierMocks["someAwesomeRoomId1"] = .init(with: .init(displayName: "First room")) + clientProxy.roomForIdentifierMocks["someAwesomeRoomId2"] = .init(with: .init(displayName: "Second room")) let summaryProvider = MockRoomSummaryProvider(state: .loaded(.mockInvites)) clientProxy.inviteSummaryProvider = summaryProvider diff --git a/NSE/Sources/Other/NSELogger.swift b/NSE/Sources/Other/NSELogger.swift index 38712d70b..b179b8fa8 100644 --- a/NSE/Sources/Other/NSELogger.swift +++ b/NSE/Sources/Other/NSELogger.swift @@ -66,7 +66,7 @@ enum NSELogger { /// Formatted memory footprint for debugging purposes /// - Returns: Memory footprint in MBs as a readable string - public static var formattedMemoryFootprint: String { + static var formattedMemoryFootprint: String { let usedBytes = UInt64(memoryFootprint ?? 0) let usedMB = Double(usedBytes) / 1024 / 1024 guard let formattedStr = numberFormatter.string(from: NSNumber(value: usedMB)) else { diff --git a/UITests/Sources/RoomScreenUITests.swift b/UITests/Sources/RoomScreenUITests.swift index f54f03cc4..1bd40481c 100644 --- a/UITests/Sources/RoomScreenUITests.swift +++ b/UITests/Sources/RoomScreenUITests.swift @@ -73,40 +73,6 @@ class RoomScreenUITests: XCTestCase { // The bottom of the timeline should remain visible with more items added above. try await app.assertScreenshot(.roomSmallTimelineLargePagination) } - - func disabled_testTimelineLayoutInMiddle() async throws { - let client = try UITestsSignalling.Client(mode: .tests) - - let app = Application.launch(.roomLayoutMiddle) - - await client.waitForApp() - defer { try? client.stop() } - - try await Task.sleep(for: .seconds(1)) // Allow the table to settle - // Given a timeline that is neither at the top nor the bottom. - app.swipeDown() - try await Task.sleep(for: .seconds(1)) // Allow the table to settle - try await app.assertScreenshot(.roomLayoutMiddle, step: 0) // Assert initial state for comparison. - - // When a back pagination occurs. - try await performOperation(.paginate, using: client) - - // Then the UI should remain unchanged. - try await app.assertScreenshot(.roomLayoutMiddle, step: 0) - - // When an incoming message arrives - try await performOperation(.incomingMessage, using: client) - - // Then the UI should still remain unchanged. - - try await app.assertScreenshot(.roomLayoutMiddle, step: 0) - - // When the keyboard appears for the message composer. - try await tapMessageComposer(in: app) - - // Then the timeline scroll offset should remain unchanged. - try await app.assertScreenshot(.roomLayoutMiddle, step: 1) - } func testTimelineLayoutAtTop() async throws { let client = try UITestsSignalling.Client(mode: .tests) diff --git a/UnitTests/Sources/InviteUsersViewModelTests.swift b/UnitTests/Sources/InviteUsersViewModelTests.swift index 0b4a7efaf..82fba9630 100644 --- a/UnitTests/Sources/InviteUsersViewModelTests.swift +++ b/UnitTests/Sources/InviteUsersViewModelTests.swift @@ -22,7 +22,6 @@ import XCTest @MainActor class InviteUsersScreenViewModelTests: XCTestCase { var viewModel: InviteUsersScreenViewModelProtocol! - var clientProxy: MockClientProxy! var userDiscoveryService: UserDiscoveryServiceMock! private var cancellables = Set() @@ -96,7 +95,6 @@ class InviteUsersScreenViewModelTests: XCTestCase { private func setupWithRoomType(roomType: InviteUsersScreenRoomType) { let usersSubject = CurrentValueSubject<[UserProfileProxy], Never>([]) - clientProxy = .init(userID: "") userDiscoveryService = UserDiscoveryServiceMock() userDiscoveryService.fetchSuggestionsReturnValue = .success([]) userDiscoveryService.searchProfilesWithReturnValue = .success([]) diff --git a/UnitTests/Sources/LayoutTests/LayoutMocks.swift b/UnitTests/Sources/LayoutTests/LayoutMocks.swift index bf521bc57..5e93b6220 100644 --- a/UnitTests/Sources/LayoutTests/LayoutMocks.swift +++ b/UnitTests/Sources/LayoutTests/LayoutMocks.swift @@ -50,11 +50,6 @@ struct LayoutSubviewsMock: Equatable, RandomAccessCollection { subscript(bounds: Range) -> LayoutSubviewsMock { LayoutSubviewsMock(subviews: Array(subviews[bounds])) } - - /// Gets the subview proxies with the specified indicies. - subscript(indices: S) -> LayoutSubviewsMock where S: Sequence, S.Element == Int { - LayoutSubviewsMock(subviews: Array(indices.map { subviews[$0] })) - } } /// A mock of the SwiftUI `LayoutSubview` struct diff --git a/UnitTests/Sources/NotificationSettingsScreenViewModelTests.swift b/UnitTests/Sources/NotificationSettingsScreenViewModelTests.swift index 6cafcf6ca..9000eb5be 100644 --- a/UnitTests/Sources/NotificationSettingsScreenViewModelTests.swift +++ b/UnitTests/Sources/NotificationSettingsScreenViewModelTests.swift @@ -24,7 +24,6 @@ class NotificationSettingsScreenViewModelTests: XCTestCase { private var viewModel: NotificationSettingsScreenViewModelProtocol! private var context: NotificationSettingsScreenViewModelType.Context! private var appSettings: AppSettings! - private var userSession: UserSessionProtocol! private var userNotificationCenter: UserNotificationCenterMock! private var notificationSettingsProxy: NotificationSettingsProxyMock! @@ -38,14 +37,8 @@ class NotificationSettingsScreenViewModelTests: XCTestCase { notificationSettingsProxy.getDefaultRoomNotificationModeIsEncryptedIsOneToOneReturnValue = .allMessages notificationSettingsProxy.isRoomMentionEnabledReturnValue = true notificationSettingsProxy.isCallEnabledReturnValue = true - - let clientProxy = MockClientProxy(userID: "@a:b.com") - userSession = MockUserSession(clientProxy: clientProxy, - mediaProvider: MockMediaProvider(), - voiceMessageMediaManager: VoiceMessageMediaManagerMock()) - - viewModel = NotificationSettingsScreenViewModel(userSession: userSession, - appSettings: appSettings, + + viewModel = NotificationSettingsScreenViewModel(appSettings: appSettings, userNotificationCenter: userNotificationCenter, notificationSettingsProxy: notificationSettingsProxy, isModallyPresented: false) diff --git a/UnitTests/Sources/RoomDetailsEditScreenViewModelTests.swift b/UnitTests/Sources/RoomDetailsEditScreenViewModelTests.swift index feab25d22..d598e0674 100644 --- a/UnitTests/Sources/RoomDetailsEditScreenViewModelTests.swift +++ b/UnitTests/Sources/RoomDetailsEditScreenViewModelTests.swift @@ -132,13 +132,3 @@ class RoomDetailsEditScreenViewModelTests: XCTestCase { userIndicatorController: userIndicatorController) } } - -private extension ImageInfo { - static let mock: ImageInfo = .init(height: nil, - width: nil, - mimetype: nil, - size: nil, - thumbnailInfo: nil, - thumbnailSource: nil, - blurhash: nil) -}