From 3b2cea4fc1d41c9736e47c475f5198da567d3b7d Mon Sep 17 00:00:00 2001 From: Mauro Romito Date: Mon, 14 Oct 2024 16:54:01 +0200 Subject: [PATCH 01/20] JoinRoomScreen ui for knocking --- .../en.lproj/Localizable.strings | 3 +- ElementX/Sources/Generated/Strings.swift | 4 ++- .../JoinRoomScreen/JoinRoomScreenModels.swift | 1 + .../JoinRoomScreen/View/JoinRoomScreen.swift | 28 ++++++++++++++++++- 4 files changed, 33 insertions(+), 3 deletions(-) diff --git a/ElementX/Resources/Localizations/en.lproj/Localizable.strings b/ElementX/Resources/Localizations/en.lproj/Localizable.strings index fea01d5a7a..b37e110987 100644 --- a/ElementX/Resources/Localizations/en.lproj/Localizable.strings +++ b/ElementX/Resources/Localizations/en.lproj/Localizable.strings @@ -341,6 +341,7 @@ "screen_create_room_access_section_header" = "Room Access"; "screen_create_room_access_section_knocking_option_description" = "Anyone can ask to join the room but an administrator or a moderator will have to accept the request"; "screen_create_room_access_section_knocking_option_title" = "Ask to join"; +"screen_join_room_knock_message_description" = "Message (optional)"; "screen_pinned_timeline_empty_state_description" = "Press on a message and choose “%1$@” to include here."; "screen_pinned_timeline_empty_state_headline" = "Pin important messages so that they can be easily discovered"; "screen_reset_encryption_password_error" = "An unknown error happened. Please check your account password is correct and try again."; @@ -504,7 +505,7 @@ "screen_invites_empty_list" = "No Invites"; "screen_invites_invited_you" = "%1$@ (%2$@) invited you"; "screen_join_room_join_action" = "Join room"; -"screen_join_room_knock_action" = "Knock to join"; +"screen_join_room_knock_action" = "Send request to join"; "screen_join_room_space_not_supported_description" = "%1$@ does not support spaces yet. You can access spaces on web."; "screen_join_room_space_not_supported_title" = "Spaces are not supported yet"; "screen_join_room_subtitle_knock" = "Click the button below and a room administrator will be notified. You’ll be able to join the conversation once approved."; diff --git a/ElementX/Sources/Generated/Strings.swift b/ElementX/Sources/Generated/Strings.swift index a14b6da1e7..82c7af023f 100644 --- a/ElementX/Sources/Generated/Strings.swift +++ b/ElementX/Sources/Generated/Strings.swift @@ -1189,8 +1189,10 @@ internal enum L10n { } /// Join room internal static var screenJoinRoomJoinAction: String { return L10n.tr("Localizable", "screen_join_room_join_action") } - /// Knock to join + /// Send request to join internal static var screenJoinRoomKnockAction: String { return L10n.tr("Localizable", "screen_join_room_knock_action") } + /// Message (optional) + internal static var screenJoinRoomKnockMessageDescription: String { return L10n.tr("Localizable", "screen_join_room_knock_message_description") } /// %1$@ does not support spaces yet. You can access spaces on web. internal static func screenJoinRoomSpaceNotSupportedDescription(_ p1: Any) -> String { return L10n.tr("Localizable", "screen_join_room_space_not_supported_description", String(describing: p1)) diff --git a/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenModels.swift b/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenModels.swift index f2c5d4ac60..9d757780d5 100644 --- a/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenModels.swift +++ b/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenModels.swift @@ -58,6 +58,7 @@ struct JoinRoomScreenViewState: BindableState { struct JoinRoomScreenViewStateBindings { var alertInfo: AlertInfo? + var knockMessage = "" } enum JoinRoomScreenAlertType { diff --git a/ElementX/Sources/Screens/JoinRoomScreen/View/JoinRoomScreen.swift b/ElementX/Sources/Screens/JoinRoomScreen/View/JoinRoomScreen.swift index 7fe3f317f5..ca726e5d7c 100644 --- a/ElementX/Sources/Screens/JoinRoomScreen/View/JoinRoomScreen.swift +++ b/ElementX/Sources/Screens/JoinRoomScreen/View/JoinRoomScreen.swift @@ -66,6 +66,32 @@ struct JoinRoomScreen: View { .multilineTextAlignment(.center) .lineLimit(3) } + + if context.viewState.mode == .knock { + Spacer() + .frame(height: 19) + VStack(alignment: .leading, spacing: 12) { + HStack(spacing: 0) { + TextField("", text: $context.knockMessage, axis: .vertical) + .onChange(of: context.knockMessage) { newValue in + context.knockMessage = String(newValue.prefix(1000)) + } + .lineLimit(4, reservesSpace: true) + .font(.compound.bodyMD) + .padding(.horizontal, 16) + .padding(.vertical, 12) + } + .background(.compound.bgCanvasDefault) + .cornerRadius(8) + .overlay(RoundedRectangle(cornerRadius: 8) + .inset(by: 0.5) + .stroke(.compound.borderInteractivePrimary)) + + Text(L10n.screenJoinRoomKnockMessageDescription) + .font(.compound.bodyMD) + .foregroundStyle(.compound.textSecondary) + } + } } } } @@ -77,7 +103,7 @@ struct JoinRoomScreen: View { EmptyView() case .knock: Button(L10n.screenJoinRoomKnockAction) { context.send(viewAction: .knock) } - .buttonStyle(.compound(.primary)) + .buttonStyle(.compound(.super)) case .join: Button(L10n.screenJoinRoomJoinAction) { context.send(viewAction: .join) } .buttonStyle(.compound(.super)) From 3af3579c8cb48545298351dfe2844f94df6e3443 Mon Sep 17 00:00:00 2001 From: Mauro Romito Date: Mon, 14 Oct 2024 17:00:25 +0200 Subject: [PATCH 02/20] code improvement --- .../JoinRoomScreen/View/JoinRoomScreen.swift | 47 ++++++++++--------- 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/ElementX/Sources/Screens/JoinRoomScreen/View/JoinRoomScreen.swift b/ElementX/Sources/Screens/JoinRoomScreen/View/JoinRoomScreen.swift index ca726e5d7c..3dc5f887f7 100644 --- a/ElementX/Sources/Screens/JoinRoomScreen/View/JoinRoomScreen.swift +++ b/ElementX/Sources/Screens/JoinRoomScreen/View/JoinRoomScreen.swift @@ -70,32 +70,37 @@ struct JoinRoomScreen: View { if context.viewState.mode == .knock { Spacer() .frame(height: 19) - VStack(alignment: .leading, spacing: 12) { - HStack(spacing: 0) { - TextField("", text: $context.knockMessage, axis: .vertical) - .onChange(of: context.knockMessage) { newValue in - context.knockMessage = String(newValue.prefix(1000)) - } - .lineLimit(4, reservesSpace: true) - .font(.compound.bodyMD) - .padding(.horizontal, 16) - .padding(.vertical, 12) - } - .background(.compound.bgCanvasDefault) - .cornerRadius(8) - .overlay(RoundedRectangle(cornerRadius: 8) - .inset(by: 0.5) - .stroke(.compound.borderInteractivePrimary)) - - Text(L10n.screenJoinRoomKnockMessageDescription) - .font(.compound.bodyMD) - .foregroundStyle(.compound.textSecondary) - } + knockMessage } } } } + @ViewBuilder + private var knockMessage: some View { + VStack(alignment: .leading, spacing: 12) { + HStack(spacing: 0) { + TextField("", text: $context.knockMessage, axis: .vertical) + .onChange(of: context.knockMessage) { newValue in + context.knockMessage = String(newValue.prefix(1000)) + } + .lineLimit(4, reservesSpace: true) + .font(.compound.bodyMD) + .padding(.horizontal, 16) + .padding(.vertical, 12) + } + .background(.compound.bgCanvasDefault) + .cornerRadius(8) + .overlay(RoundedRectangle(cornerRadius: 8) + .inset(by: 0.5) + .stroke(.compound.borderInteractivePrimary)) + + Text(L10n.screenJoinRoomKnockMessageDescription) + .font(.compound.bodyMD) + .foregroundStyle(.compound.textSecondary) + } + } + @ViewBuilder var buttons: some View { switch context.viewState.mode { From 9bc22236ab5638c61b5438c8c7e02a293b9b759a Mon Sep 17 00:00:00 2001 From: Mauro Romito Date: Wed, 16 Oct 2024 12:49:24 +0200 Subject: [PATCH 03/20] updated previews --- .../PreviewTests/test_joinRoomScreen-iPad-en-GB.Knock.png | 4 ++-- .../PreviewTests/test_joinRoomScreen-iPad-pseudo.Knock.png | 4 ++-- .../test_joinRoomScreen-iPhone-16-en-GB.Knock.png | 4 ++-- .../test_joinRoomScreen-iPhone-16-pseudo.Knock.png | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-en-GB.Knock.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-en-GB.Knock.png index 1789652cdb..84559893b7 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-en-GB.Knock.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-en-GB.Knock.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b9bb89feeb7a80c3bdd110bf69eb2efb08b009ebcb30825a24c2343a537280df -size 1938161 +oid sha256:74053afd3062c5e8b6c09ef420ec590ec429fc908b465e4f72d8dffe7cf34c60 +size 1787832 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-pseudo.Knock.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-pseudo.Knock.png index 60860bc7e2..ca99716e25 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-pseudo.Knock.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-pseudo.Knock.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:bd7969bf12e64467689fe589abd6f193425b114778f0cfac04ec6abf78000b98 -size 1938771 +oid sha256:2f0d4419f5cc74e3cc298002779c99729181ba929020c5717d7def92ded491d8 +size 1796287 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-en-GB.Knock.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-en-GB.Knock.png index 49e1c4a792..49f652ceac 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-en-GB.Knock.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-en-GB.Knock.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4fb08acf5df0a46b166d2e0b4b4ebcdf399c5ce0acf6b6b728124b817aae8d0c -size 791872 +oid sha256:e195355501280ad576a31e05499b6a6e1eb251e9f711e2e37df249159ab577ea +size 700519 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-pseudo.Knock.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-pseudo.Knock.png index c2b2930b16..8700315e07 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-pseudo.Knock.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-pseudo.Knock.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9685beb39e3ca4a7509b5438ec4733fce1019d8aae6fb12d2a1a87214a971b00 -size 793600 +oid sha256:ce7c84f3afc25ecee477b9df120b28d162060035678fc05f61bd0a0dcc8d7312 +size 708952 From 676c63a6916f15d5d19c427012e12e78f5de5def Mon Sep 17 00:00:00 2001 From: Mauro Romito Date: Wed, 16 Oct 2024 18:52:23 +0200 Subject: [PATCH 04/20] added knocked state with tests --- ElementX.xcodeproj/project.pbxproj | 48 ++-- .../en.lproj/Localizable.strings | 4 + ElementX/Sources/Generated/Strings.swift | 8 + .../Mocks/Generated/GeneratedMocks.swift | 251 ++++++++++++++++++ .../Sources/Mocks/KnockedRoomProxyMock.swift | 29 ++ .../JoinRoomScreenCoordinator.swift | 1 + .../JoinRoomScreen/JoinRoomScreenModels.swift | 7 + .../JoinRoomScreenViewModel.swift | 46 +++- .../JoinRoomScreen/View/JoinRoomScreen.swift | 48 +++- .../Sources/Services/Client/ClientProxy.swift | 34 ++- .../Services/Client/ClientProxyProtocol.swift | 4 + .../Services/Room/KnockedRoomProxy.swift | 82 ++++++ .../Services/Room/RoomProxyProtocol.swift | 6 + ...test_joinRoomScreen-iPad-en-GB.Knocked.png | 3 + ...est_joinRoomScreen-iPad-pseudo.Knocked.png | 3 + ...joinRoomScreen-iPhone-16-en-GB.Knocked.png | 3 + ...oinRoomScreen-iPhone-16-pseudo.Knocked.png | 3 + .../JoinRoomScreenViewModelTests.swift | 24 +- 18 files changed, 573 insertions(+), 31 deletions(-) create mode 100644 ElementX/Sources/Mocks/KnockedRoomProxyMock.swift create mode 100644 ElementX/Sources/Services/Room/KnockedRoomProxy.swift create mode 100644 PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-en-GB.Knocked.png create mode 100644 PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-pseudo.Knocked.png create mode 100644 PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-en-GB.Knocked.png create mode 100644 PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-pseudo.Knocked.png diff --git a/ElementX.xcodeproj/project.pbxproj b/ElementX.xcodeproj/project.pbxproj index 56e4832517..dfda797d7f 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 */ @@ -767,6 +767,8 @@ A6D4C5EEA85A6A0ABA1559D6 /* RoomDetailsEditScreenModels.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16D09C79746BDCD9173EB3A7 /* RoomDetailsEditScreenModels.swift */; }; A6DEC1ADEC8FEEC206A0FA37 /* AttributedStringBuilderProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 72F37B5DA798C9AE436F2C2C /* AttributedStringBuilderProtocol.swift */; }; A6F345328CCC5C9B0DAE2257 /* LogViewerScreenViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0BB05221D7D941CC82DC8480 /* LogViewerScreenViewModel.swift */; }; + A71F957D2CBFF33100FDBDF2 /* KnockedRoomProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = A71F957C2CBFF32A00FDBDF2 /* KnockedRoomProxy.swift */; }; + A71F957F2CBFFD2500FDBDF2 /* KnockedRoomProxyMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = A71F957E2CBFFD1F00FDBDF2 /* KnockedRoomProxyMock.swift */; }; A722F426FD81FC67706BB1E0 /* CustomLayoutLabelStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 42236480CF0431535EBE8387 /* CustomLayoutLabelStyle.swift */; }; A74438ED16F8683A4B793E6A /* AnalyticsSettingsScreenViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0BCE3FAF40932AC7C7639AC4 /* AnalyticsSettingsScreenViewModel.swift */; }; A7D48E44D485B143AADDB77D /* Strings+Untranslated.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1A18F6CE4D694D21E4EA9B25 /* Strings+Untranslated.swift */; }; @@ -1213,13 +1215,13 @@ 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 = ""; }; 045253F9967A535EE5B16691 /* Label.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Label.swift; sourceTree = ""; }; 046C0D3F53B0B5EF0A1F5BEA /* RoomSummaryTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomSummaryTests.swift; sourceTree = ""; }; - 048A21188AB19349D026BECD /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; path = PrivacyInfo.xcprivacy; sourceTree = ""; }; + 048A21188AB19349D026BECD /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = ""; }; 04BB8DDE245ED86C489BA983 /* AccessibilityIdentifiers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccessibilityIdentifiers.swift; sourceTree = ""; }; 04DF593C3F7AF4B2FBAEB05D /* FileManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileManager.swift; sourceTree = ""; }; 0516C69708D5CBDE1A8E77EC /* RoomDirectorySearchProxyProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomDirectorySearchProxyProtocol.swift; sourceTree = ""; }; @@ -1285,7 +1287,7 @@ 127A57D053CE8C87B5EFB089 /* Consumable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Consumable.swift; sourceTree = ""; }; 127C8472672A5BA09EF1ACF8 /* CurrentValuePublisher.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CurrentValuePublisher.swift; sourceTree = ""; }; 128501375217576AF0FE3E92 /* RoomAttachmentPicker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomAttachmentPicker.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 = ""; }; 136F80A613B55BDD071DCEA5 /* JoinRoomScreenModels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JoinRoomScreenModels.swift; sourceTree = ""; }; 13802897C7AFA360EA74C0B0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = en; path = en.lproj/Localizable.stringsdict; sourceTree = ""; }; @@ -1374,7 +1376,7 @@ 25F7FE40EF7490A7E09D7BE6 /* NotificationItemProxy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationItemProxy.swift; sourceTree = ""; }; 25F8664F1FB95AF3C4202478 /* PollFormScreenCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PollFormScreenCoordinator.swift; sourceTree = ""; }; 260004737C573A56FA01E86E /* Encodable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Encodable.swift; sourceTree = ""; }; - 267BB1D5B08A9511F894CB57 /* PreviewTests.xctestplan */ = {isa = PBXFileReference; path = PreviewTests.xctestplan; sourceTree = ""; }; + 267BB1D5B08A9511F894CB57 /* PreviewTests.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = PreviewTests.xctestplan; sourceTree = ""; }; 26B0A96B8FE4849227945067 /* VoiceMessageRecorder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VoiceMessageRecorder.swift; sourceTree = ""; }; 26EAAB54C6CE91D64B69A9F8 /* AppLockServiceProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppLockServiceProtocol.swift; sourceTree = ""; }; 2721D7B051F0159AA919DA05 /* RoomChangePermissionsScreenViewModelProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomChangePermissionsScreenViewModelProtocol.swift; sourceTree = ""; }; @@ -1445,7 +1447,7 @@ 3558A15CFB934F9229301527 /* RestorationToken.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RestorationToken.swift; sourceTree = ""; }; 35AFCF4C05DEED04E3DB1A16 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/Localizable.strings; sourceTree = ""; }; 35FA991289149D31F4286747 /* UserPreference.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserPreference.swift; sourceTree = ""; }; - 36DA824791172B9821EACBED /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; path = PrivacyInfo.xcprivacy; sourceTree = ""; }; + 36DA824791172B9821EACBED /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = ""; }; 36FD673E24FBFCFDF398716A /* RoomMemberProxyMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomMemberProxyMock.swift; sourceTree = ""; }; 376D941BF8BB294389C0DE24 /* MapTilerURLBuildersTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapTilerURLBuildersTests.swift; sourceTree = ""; }; 37A243E04B58DC6E41FDCD82 /* EmojiItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmojiItem.swift; sourceTree = ""; }; @@ -1549,7 +1551,7 @@ 4B41FABA2B0AEF4389986495 /* LoginMode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginMode.swift; sourceTree = ""; }; 4BD371B60E07A5324B9507EF /* AnalyticsSettingsScreenCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnalyticsSettingsScreenCoordinator.swift; sourceTree = ""; }; 4C8D988E82A8DFA13BE46F7C /* pl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = pl; path = pl.lproj/Localizable.stringsdict; sourceTree = ""; }; - 4CD6AC7546E8D7E5C73CEA48 /* ElementX.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = ElementX.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 4CD6AC7546E8D7E5C73CEA48 /* ElementX.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ElementX.app; sourceTree = BUILT_PRODUCTS_DIR; }; 4CDDDDD9FE1A699D23A5E096 /* LoginScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginScreen.swift; sourceTree = ""; }; 4D3A7375AB22721C436EB056 /* ComposerToolbarModels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ComposerToolbarModels.swift; sourceTree = ""; }; 4E2245243369B99216C7D84E /* ImageCache.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageCache.swift; sourceTree = ""; }; @@ -1815,7 +1817,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 = ""; }; 8DA1E8F287680C8ED25EDBAC /* NetworkMonitorMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkMonitorMock.swift; sourceTree = ""; }; - 8E088F2A1B9EC529D3221931 /* UITests.xctestplan */ = {isa = PBXFileReference; path = UITests.xctestplan; sourceTree = ""; }; + 8E088F2A1B9EC529D3221931 /* UITests.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = UITests.xctestplan; sourceTree = ""; }; 8E1584F8BCF407BB94F48F04 /* EncryptionResetPasswordScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EncryptionResetPasswordScreen.swift; sourceTree = ""; }; 8EAF4A49F3ACD8BB8B0D2371 /* ClientSDKMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClientSDKMock.swift; sourceTree = ""; }; 8F21ED7205048668BEB44A38 /* AppActivityView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppActivityView.swift; sourceTree = ""; }; @@ -1917,6 +1919,8 @@ A6B891A6DA826E2461DBB40F /* PHGPostHogConfiguration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PHGPostHogConfiguration.swift; sourceTree = ""; }; A6C11AD9813045E44F950410 /* ElementCallWidgetDriverProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ElementCallWidgetDriverProtocol.swift; sourceTree = ""; }; A6EA0D8B0BBD8805F7D5A133 /* TextBasedRoomTimelineViewProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextBasedRoomTimelineViewProtocol.swift; sourceTree = ""; }; + A71F957C2CBFF32A00FDBDF2 /* KnockedRoomProxy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KnockedRoomProxy.swift; sourceTree = ""; }; + A71F957E2CBFFD1F00FDBDF2 /* KnockedRoomProxyMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KnockedRoomProxyMock.swift; sourceTree = ""; }; A73A07BAEDD74C48795A996A /* AsyncSequence.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AsyncSequence.swift; sourceTree = ""; }; A7978C9EFBDD7DE39BD86726 /* RestorationTokenTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RestorationTokenTests.swift; sourceTree = ""; }; A7C4EA55DA62F9D0F984A2AE /* CollapsibleTimelineItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CollapsibleTimelineItem.swift; sourceTree = ""; }; @@ -1991,7 +1995,7 @@ B50F03079F6B5EF9CA005F14 /* TimelineProxyProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimelineProxyProtocol.swift; sourceTree = ""; }; B53AC78E49A297AC1D72A7CF /* AppMediator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppMediator.swift; sourceTree = ""; }; B590BD4507D4F0A377FDE01A /* LoadableAvatarImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoadableAvatarImage.swift; sourceTree = ""; }; - B61C339A2FDDBD067FF6635C /* ConfettiScene.scn */ = {isa = PBXFileReference; path = ConfettiScene.scn; sourceTree = ""; }; + B61C339A2FDDBD067FF6635C /* ConfettiScene.scn */ = {isa = PBXFileReference; lastKnownFileType = file.bplist; path = ConfettiScene.scn; sourceTree = ""; }; B63B69F9A2BC74DD40DC75C8 /* AdvancedSettingsScreenViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdvancedSettingsScreenViewModel.swift; sourceTree = ""; }; B6404166CBF5CC88673FF9E2 /* RoomDetails.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomDetails.swift; sourceTree = ""; }; B655A536341D2695158C6664 /* AuthenticationClientBuilderFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthenticationClientBuilderFactory.swift; sourceTree = ""; }; @@ -2106,7 +2110,7 @@ CDB3227C7A74B734924942E9 /* RoomSummaryProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomSummaryProvider.swift; sourceTree = ""; }; CDE3F3911FF7CC639BDE5844 /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/Localizable.strings; sourceTree = ""; }; CEE20623EB4A9B88FB29F2BA /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/SAS.strings; sourceTree = ""; }; - CEE41494C837AA403A06A5D9 /* UnitTests.xctestplan */ = {isa = PBXFileReference; path = UnitTests.xctestplan; sourceTree = ""; }; + CEE41494C837AA403A06A5D9 /* UnitTests.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = UnitTests.xctestplan; sourceTree = ""; }; D071F86CD47582B9196C9D16 /* UserDiscoverySection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserDiscoverySection.swift; sourceTree = ""; }; D086854995173E897F993C26 /* AdvancedSettingsScreenViewModelProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdvancedSettingsScreenViewModelProtocol.swift; sourceTree = ""; }; D09A267106B9585D3D0CFC0D /* ClientError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClientError.swift; sourceTree = ""; }; @@ -2237,7 +2241,7 @@ ED0CBEAB5F796BEFBAF7BB6A /* VideoRoomTimelineView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VideoRoomTimelineView.swift; sourceTree = ""; }; ED1D792EB82506A19A72C8DE /* RoomTimelineItemProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomTimelineItemProtocol.swift; sourceTree = ""; }; ED33988DA4FD4FC666800106 /* SessionVerificationScreenViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SessionVerificationScreenViewModel.swift; sourceTree = ""; }; - ED482057AE39D5C6D9C5F3D8 /* message.caf */ = {isa = PBXFileReference; path = message.caf; sourceTree = ""; }; + ED482057AE39D5C6D9C5F3D8 /* message.caf */ = {isa = PBXFileReference; lastKnownFileType = file; path = message.caf; sourceTree = ""; }; ED49073BB1C1FC649DAC2CCD /* LocationRoomTimelineView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocationRoomTimelineView.swift; sourceTree = ""; }; ED60E4D2CD678E1EBF16F77A /* BlockedUsersScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BlockedUsersScreen.swift; sourceTree = ""; }; EE378083653EF0C9B5E9D580 /* EmoteRoomTimelineItemContent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmoteRoomTimelineItemContent.swift; sourceTree = ""; }; @@ -2259,7 +2263,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 = ""; }; F2E4EF80DFB8FE7C4469B15D /* RoomDirectorySearchScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomDirectorySearchScreen.swift; 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 = ""; }; @@ -2899,6 +2903,7 @@ 31CE4DA53232AA534057F912 /* Mocks */ = { isa = PBXGroup; children = ( + A71F957E2CBFFD1F00FDBDF2 /* KnockedRoomProxyMock.swift */, 69CB8242D69B7E4D0B32E18D /* AggregatedReactionMock.swift */, 3BAC027034248429A438886B /* AppMediatorMock.swift */, 0554FEA301486A8CFA475D5A /* AuthenticationClientBuilderFactoryMock.swift */, @@ -3195,6 +3200,7 @@ 40E6246F03D1FE377BC5D963 /* Room */ = { isa = PBXGroup; children = ( + A71F957C2CBFF32A00FDBDF2 /* KnockedRoomProxy.swift */, 0E95B3BDB80531C85CD50AE6 /* InvitedRoomProxy.swift */, 07C6B0B087FE6601C3F77816 /* JoinedRoomProxy.swift */, B6404166CBF5CC88673FF9E2 /* RoomDetails.swift */, @@ -6450,6 +6456,7 @@ 46A6DB0F78FB399BD59E2D41 /* EncryptionKeyProviderProtocol.swift in Sources */, 0C6DF318E9C8F6461E6ABDE7 /* EncryptionResetPasswordScreen.swift in Sources */, 36926D795D6D19177C7812F8 /* EncryptionResetPasswordScreenCoordinator.swift in Sources */, + A71F957D2CBFF33100FDBDF2 /* KnockedRoomProxy.swift in Sources */, B1B255CE0E4306DD6E09D936 /* EncryptionResetPasswordScreenModels.swift in Sources */, D6152E21036B88C44ECB22E7 /* EncryptionResetPasswordScreenViewModel.swift in Sources */, A0601810597769B81C2358AF /* EncryptionResetPasswordScreenViewModelProtocol.swift in Sources */, @@ -6607,6 +6614,7 @@ EA01A06EEDFEF4AE7652E5F3 /* NSRegularExpresion.swift in Sources */, FA2BBAE9FC5E2E9F960C0980 /* NavigationCoordinators.swift in Sources */, 71C1347F23868324A4F43940 /* NavigationModule.swift in Sources */, + A71F957F2CBFFD2500FDBDF2 /* KnockedRoomProxyMock.swift in Sources */, B5E455C9689EA600EDB3E9E0 /* NavigationRootCoordinator.swift in Sources */, 93BAF04D9CCBC0A8841414D0 /* NetworkMonitor.swift in Sources */, 96B3606E30F824095B1DD022 /* NetworkMonitorMock.swift in Sources */, @@ -7277,9 +7285,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; @@ -7328,9 +7334,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)"; @@ -7356,9 +7360,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)"; @@ -7603,9 +7605,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/Resources/Localizations/en.lproj/Localizable.strings b/ElementX/Resources/Localizations/en.lproj/Localizable.strings index b37e110987..3724e95cab 100644 --- a/ElementX/Resources/Localizations/en.lproj/Localizable.strings +++ b/ElementX/Resources/Localizations/en.lproj/Localizable.strings @@ -226,6 +226,7 @@ "common_username" = "Username"; "common_verification_cancelled" = "Verification cancelled"; "common_verification_complete" = "Verification complete"; +"common_verified" = "Verified"; "common_verify_device" = "Verify device"; "common_video" = "Video"; "common_voice_message" = "Voice message"; @@ -341,7 +342,10 @@ "screen_create_room_access_section_header" = "Room Access"; "screen_create_room_access_section_knocking_option_description" = "Anyone can ask to join the room but an administrator or a moderator will have to accept the request"; "screen_create_room_access_section_knocking_option_title" = "Ask to join"; +"screen_join_room_cancel_knock_action" = "Cancel request"; "screen_join_room_knock_message_description" = "Message (optional)"; +"screen_join_room_knock_sent_description" = "You will receive an invite to join the room if your request is accepted."; +"screen_join_room_knock_sent_title" = "Request to join sent"; "screen_pinned_timeline_empty_state_description" = "Press on a message and choose “%1$@” to include here."; "screen_pinned_timeline_empty_state_headline" = "Pin important messages so that they can be easily discovered"; "screen_reset_encryption_password_error" = "An unknown error happened. Please check your account password is correct and try again."; diff --git a/ElementX/Sources/Generated/Strings.swift b/ElementX/Sources/Generated/Strings.swift index 82c7af023f..11dfb30e47 100644 --- a/ElementX/Sources/Generated/Strings.swift +++ b/ElementX/Sources/Generated/Strings.swift @@ -502,6 +502,8 @@ internal enum L10n { internal static var commonVerificationCancelled: String { return L10n.tr("Localizable", "common_verification_cancelled") } /// Verification complete internal static var commonVerificationComplete: String { return L10n.tr("Localizable", "common_verification_complete") } + /// Verified + internal static var commonVerified: String { return L10n.tr("Localizable", "common_verified") } /// Verify device internal static var commonVerifyDevice: String { return L10n.tr("Localizable", "common_verify_device") } /// Video @@ -1187,12 +1189,18 @@ internal enum L10n { internal static func screenInvitesInvitedYou(_ p1: Any, _ p2: Any) -> String { return L10n.tr("Localizable", "screen_invites_invited_you", String(describing: p1), String(describing: p2)) } + /// Cancel request + internal static var screenJoinRoomCancelKnockAction: String { return L10n.tr("Localizable", "screen_join_room_cancel_knock_action") } /// Join room internal static var screenJoinRoomJoinAction: String { return L10n.tr("Localizable", "screen_join_room_join_action") } /// Send request to join internal static var screenJoinRoomKnockAction: String { return L10n.tr("Localizable", "screen_join_room_knock_action") } /// Message (optional) internal static var screenJoinRoomKnockMessageDescription: String { return L10n.tr("Localizable", "screen_join_room_knock_message_description") } + /// You will receive an invite to join the room if your request is accepted. + internal static var screenJoinRoomKnockSentDescription: String { return L10n.tr("Localizable", "screen_join_room_knock_sent_description") } + /// Request to join sent + internal static var screenJoinRoomKnockSentTitle: String { return L10n.tr("Localizable", "screen_join_room_knock_sent_title") } /// %1$@ does not support spaces yet. You can access spaces on web. internal static func screenJoinRoomSpaceNotSupportedDescription(_ p1: Any) -> String { return L10n.tr("Localizable", "screen_join_room_space_not_supported_description", String(describing: p1)) diff --git a/ElementX/Sources/Mocks/Generated/GeneratedMocks.swift b/ElementX/Sources/Mocks/Generated/GeneratedMocks.swift index 1b472cd45a..039932ee7f 100644 --- a/ElementX/Sources/Mocks/Generated/GeneratedMocks.swift +++ b/ElementX/Sources/Mocks/Generated/GeneratedMocks.swift @@ -2835,6 +2835,146 @@ class ClientProxyMock: ClientProxyProtocol { return joinRoomAliasReturnValue } } + //MARK: - knockRoom + + var knockRoomMessageUnderlyingCallsCount = 0 + var knockRoomMessageCallsCount: Int { + get { + if Thread.isMainThread { + return knockRoomMessageUnderlyingCallsCount + } else { + var returnValue: Int? = nil + DispatchQueue.main.sync { + returnValue = knockRoomMessageUnderlyingCallsCount + } + + return returnValue! + } + } + set { + if Thread.isMainThread { + knockRoomMessageUnderlyingCallsCount = newValue + } else { + DispatchQueue.main.sync { + knockRoomMessageUnderlyingCallsCount = newValue + } + } + } + } + var knockRoomMessageCalled: Bool { + return knockRoomMessageCallsCount > 0 + } + var knockRoomMessageReceivedArguments: (roomID: String, message: String?)? + var knockRoomMessageReceivedInvocations: [(roomID: String, message: String?)] = [] + + var knockRoomMessageUnderlyingReturnValue: Result! + var knockRoomMessageReturnValue: Result! { + get { + if Thread.isMainThread { + return knockRoomMessageUnderlyingReturnValue + } else { + var returnValue: Result? = nil + DispatchQueue.main.sync { + returnValue = knockRoomMessageUnderlyingReturnValue + } + + return returnValue! + } + } + set { + if Thread.isMainThread { + knockRoomMessageUnderlyingReturnValue = newValue + } else { + DispatchQueue.main.sync { + knockRoomMessageUnderlyingReturnValue = newValue + } + } + } + } + var knockRoomMessageClosure: ((String, String?) async -> Result)? + + func knockRoom(_ roomID: String, message: String?) async -> Result { + knockRoomMessageCallsCount += 1 + knockRoomMessageReceivedArguments = (roomID: roomID, message: message) + DispatchQueue.main.async { + self.knockRoomMessageReceivedInvocations.append((roomID: roomID, message: message)) + } + if let knockRoomMessageClosure = knockRoomMessageClosure { + return await knockRoomMessageClosure(roomID, message) + } else { + return knockRoomMessageReturnValue + } + } + //MARK: - knockRoomAlias + + var knockRoomAliasMessageUnderlyingCallsCount = 0 + var knockRoomAliasMessageCallsCount: Int { + get { + if Thread.isMainThread { + return knockRoomAliasMessageUnderlyingCallsCount + } else { + var returnValue: Int? = nil + DispatchQueue.main.sync { + returnValue = knockRoomAliasMessageUnderlyingCallsCount + } + + return returnValue! + } + } + set { + if Thread.isMainThread { + knockRoomAliasMessageUnderlyingCallsCount = newValue + } else { + DispatchQueue.main.sync { + knockRoomAliasMessageUnderlyingCallsCount = newValue + } + } + } + } + var knockRoomAliasMessageCalled: Bool { + return knockRoomAliasMessageCallsCount > 0 + } + var knockRoomAliasMessageReceivedArguments: (roomAlias: String, message: String?)? + var knockRoomAliasMessageReceivedInvocations: [(roomAlias: String, message: String?)] = [] + + var knockRoomAliasMessageUnderlyingReturnValue: Result! + var knockRoomAliasMessageReturnValue: Result! { + get { + if Thread.isMainThread { + return knockRoomAliasMessageUnderlyingReturnValue + } else { + var returnValue: Result? = nil + DispatchQueue.main.sync { + returnValue = knockRoomAliasMessageUnderlyingReturnValue + } + + return returnValue! + } + } + set { + if Thread.isMainThread { + knockRoomAliasMessageUnderlyingReturnValue = newValue + } else { + DispatchQueue.main.sync { + knockRoomAliasMessageUnderlyingReturnValue = newValue + } + } + } + } + var knockRoomAliasMessageClosure: ((String, String?) async -> Result)? + + func knockRoomAlias(_ roomAlias: String, message: String?) async -> Result { + knockRoomAliasMessageCallsCount += 1 + knockRoomAliasMessageReceivedArguments = (roomAlias: roomAlias, message: message) + DispatchQueue.main.async { + self.knockRoomAliasMessageReceivedInvocations.append((roomAlias: roomAlias, message: message)) + } + if let knockRoomAliasMessageClosure = knockRoomAliasMessageClosure { + return await knockRoomAliasMessageClosure(roomAlias, message) + } else { + return knockRoomAliasMessageReturnValue + } + } //MARK: - uploadMedia var uploadMediaUnderlyingCallsCount = 0 @@ -9541,6 +9681,117 @@ class KeychainControllerMock: KeychainControllerProtocol { removePINCodeBiometricStateClosure?() } } +class KnockedRoomProxyMock: KnockedRoomProxyProtocol { + var id: String { + get { return underlyingId } + set(value) { underlyingId = value } + } + var underlyingId: String! + var canonicalAlias: String? + var ownUserID: String { + get { return underlyingOwnUserID } + set(value) { underlyingOwnUserID = value } + } + var underlyingOwnUserID: String! + var name: String? + var topic: String? + var avatar: RoomAvatar { + get { return underlyingAvatar } + set(value) { underlyingAvatar = value } + } + var underlyingAvatar: RoomAvatar! + var avatarURL: URL? + var isPublic: Bool { + get { return underlyingIsPublic } + set(value) { underlyingIsPublic = value } + } + var underlyingIsPublic: Bool! + var isDirect: Bool { + get { return underlyingIsDirect } + set(value) { underlyingIsDirect = value } + } + var underlyingIsDirect: Bool! + var isSpace: Bool { + get { return underlyingIsSpace } + set(value) { underlyingIsSpace = value } + } + var underlyingIsSpace: Bool! + var joinedMembersCount: Int { + get { return underlyingJoinedMembersCount } + set(value) { underlyingJoinedMembersCount = value } + } + var underlyingJoinedMembersCount: Int! + var activeMembersCount: Int { + get { return underlyingActiveMembersCount } + set(value) { underlyingActiveMembersCount = value } + } + var underlyingActiveMembersCount: Int! + + //MARK: - cancelKnock + + var cancelKnockUnderlyingCallsCount = 0 + var cancelKnockCallsCount: Int { + get { + if Thread.isMainThread { + return cancelKnockUnderlyingCallsCount + } else { + var returnValue: Int? = nil + DispatchQueue.main.sync { + returnValue = cancelKnockUnderlyingCallsCount + } + + return returnValue! + } + } + set { + if Thread.isMainThread { + cancelKnockUnderlyingCallsCount = newValue + } else { + DispatchQueue.main.sync { + cancelKnockUnderlyingCallsCount = newValue + } + } + } + } + var cancelKnockCalled: Bool { + return cancelKnockCallsCount > 0 + } + + var cancelKnockUnderlyingReturnValue: Result! + var cancelKnockReturnValue: Result! { + get { + if Thread.isMainThread { + return cancelKnockUnderlyingReturnValue + } else { + var returnValue: Result? = nil + DispatchQueue.main.sync { + returnValue = cancelKnockUnderlyingReturnValue + } + + return returnValue! + } + } + set { + if Thread.isMainThread { + cancelKnockUnderlyingReturnValue = newValue + } else { + DispatchQueue.main.sync { + cancelKnockUnderlyingReturnValue = newValue + } + } + } + } + var cancelKnockClosure: (() async -> Result)? + + func cancelKnock() async -> Result { + cancelKnockCallsCount += 1 + if let cancelKnockClosure = cancelKnockClosure { + return await cancelKnockClosure() + } else { + return cancelKnockReturnValue + } + } +} class MediaLoaderMock: MediaLoaderProtocol { //MARK: - loadMediaContentForSource diff --git a/ElementX/Sources/Mocks/KnockedRoomProxyMock.swift b/ElementX/Sources/Mocks/KnockedRoomProxyMock.swift new file mode 100644 index 0000000000..3fc2e5e387 --- /dev/null +++ b/ElementX/Sources/Mocks/KnockedRoomProxyMock.swift @@ -0,0 +1,29 @@ +// +// Copyright 2024 New Vector Ltd. +// +// SPDX-License-Identifier: AGPL-3.0-only +// Please see LICENSE in the repository root for full details. +// + +import Combine +import Foundation + +@MainActor +struct KnockedRoomProxyMockConfiguration { + var id = UUID().uuidString + var name: String? + var avatarURL: URL? + var members: [RoomMemberProxyMock] = .allMembers +} + +extension KnockedRoomProxyMock { + @MainActor + convenience init(_ configuration: KnockedRoomProxyMockConfiguration) { + self.init() + id = configuration.id + name = configuration.name + avatarURL = avatarURL + avatar = .room(id: configuration.id, name: configuration.name, avatarURL: configuration.avatarURL) // Note: This doesn't replicate the real proxy logic. + activeMembersCount = configuration.members.filter { $0.membership == .join || $0.membership == .invite }.count + } +} diff --git a/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenCoordinator.swift b/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenCoordinator.swift index e669b42049..2d9e0d2ceb 100644 --- a/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenCoordinator.swift +++ b/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenCoordinator.swift @@ -34,6 +34,7 @@ final class JoinRoomScreenCoordinator: CoordinatorProtocol { init(parameters: JoinRoomScreenCoordinatorParameters) { viewModel = JoinRoomScreenViewModel(roomID: parameters.roomID, via: parameters.via, + appSettings: ServiceLocator.shared.settings, clientProxy: parameters.clientProxy, mediaProvider: parameters.mediaProvider, userIndicatorController: parameters.userIndicatorController) diff --git a/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenModels.swift b/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenModels.swift index 9d757780d5..44d23c228b 100644 --- a/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenModels.swift +++ b/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenModels.swift @@ -18,6 +18,7 @@ enum JoinRoomScreenInteractionMode { case invited case join case knock + case knocked } struct JoinRoomScreenRoomDetails { @@ -48,12 +49,17 @@ struct JoinRoomScreenViewState: BindableState { case .loading: nil case .unknown: L10n.screenJoinRoomSubtitleNoPreview case .invited, .join, .knock: roomDetails?.canonicalAlias + case .knocked: nil } } var avatar: RoomAvatar { roomDetails?.avatar ?? .room(id: roomID, name: title, avatarURL: nil) } + + var isEmptyKnockMessage: Bool { + bindings.knockMessage.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty + } } struct JoinRoomScreenViewStateBindings { @@ -66,6 +72,7 @@ enum JoinRoomScreenAlertType { } enum JoinRoomScreenViewAction { + case cancelKnock case knock case join case acceptInvite diff --git a/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenViewModel.swift b/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenViewModel.swift index da59f09bad..b8c64349ff 100644 --- a/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenViewModel.swift +++ b/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenViewModel.swift @@ -13,7 +13,7 @@ typealias JoinRoomScreenViewModelType = StateStoreViewModel JoinRoomScreenViewModel { @@ -176,11 +213,18 @@ struct JoinRoomScreen_Previews: PreviewProvider, TestablePreview { (false, false, true, false) case .knock: (false, false, false, true) + case .knocked: + (false, false, false, false) } if mode == .unknown { clientProxy.roomPreviewForIdentifierViaReturnValue = .failure(.sdkError(ClientProxyMockError.generic)) } else { + if mode == .knocked { + clientProxy.roomForIdentifierClosure = { _ in + .knocked(KnockedRoomProxyMock(.init())) + } + } clientProxy.roomPreviewForIdentifierViaReturnValue = .success(.init(roomID: "1", name: "The Three-Body Problem - 三体", canonicalAlias: "#3🌞problem:matrix.org", @@ -195,9 +239,11 @@ struct JoinRoomScreen_Previews: PreviewProvider, TestablePreview { canKnock: membership.canKnock)) } + ServiceLocator.shared.settings.knockingEnabled = true + return JoinRoomScreenViewModel(roomID: "1", via: [], - allowKnocking: true, + appSettings: ServiceLocator.shared.settings, clientProxy: clientProxy, mediaProvider: MediaProviderMock(configuration: .init()), userIndicatorController: ServiceLocator.shared.userIndicatorController) diff --git a/ElementX/Sources/Services/Client/ClientProxy.swift b/ElementX/Sources/Services/Client/ClientProxy.swift index 72a647283a..06972a1ec7 100644 --- a/ElementX/Sources/Services/Client/ClientProxy.swift +++ b/ElementX/Sources/Services/Client/ClientProxy.swift @@ -415,6 +415,30 @@ class ClientProxy: ClientProxyProtocol { } } + func knockRoom(_ roomID: String, message: String?) async -> Result { + do { + // TODO: It should also include a message but the API for is not available yet + let _ = try await client.knock(roomIdOrAlias: roomID) + await waitForRoomToSync(roomID: roomID, timeout: .seconds(30)) + return .success(()) + } catch { + MXLog.error("Failed knocking roomID: \(roomID) with error: \(error)") + return .failure(.sdkError(error)) + } + } + + func knockRoomAlias(_ roomAlias: String, message: String?) async -> Result { + do { + // TODO: It should also include a message but the API for is not available yet + let room = try await client.knock(roomIdOrAlias: roomAlias) + await waitForRoomToSync(roomID: room.id(), timeout: .seconds(30)) + return .success(()) + } catch { + MXLog.error("Failed knocking roomAlias: \(roomAlias) with error: \(error)") + return .failure(.sdkError(error)) + } + } + func uploadMedia(_ media: MediaInfo) async -> Result { guard let mimeType = media.mimeType else { MXLog.error("Failed uploading media, invalid mime type: \(media)") @@ -846,9 +870,17 @@ class ClientProxy: ClientProxyProtocol { let roomListItem = try roomListService.room(roomId: roomID) switch roomListItem.membership() { - case .invited, .knocked: + case .invited: return try .invited(InvitedRoomProxy(roomListItem: roomListItem, room: roomListItem.invitedRoom())) + case .knocked: + if appSettings.knockingEnabled { + return try .knocked(KnockedRoomProxy(roomListItem: roomListItem, + room: roomListItem.invitedRoom())) + } else { + return try .invited(InvitedRoomProxy(roomListItem: roomListItem, + room: roomListItem.invitedRoom())) + } case .joined: if roomListItem.isTimelineInitialized() == false { try await roomListItem.initTimeline(eventTypeFilter: eventFilters, internalIdPrefix: nil) diff --git a/ElementX/Sources/Services/Client/ClientProxyProtocol.swift b/ElementX/Sources/Services/Client/ClientProxyProtocol.swift index e8160f2412..aa7663a533 100644 --- a/ElementX/Sources/Services/Client/ClientProxyProtocol.swift +++ b/ElementX/Sources/Services/Client/ClientProxyProtocol.swift @@ -145,6 +145,10 @@ protocol ClientProxyProtocol: AnyObject, MediaLoaderProtocol { func joinRoomAlias(_ roomAlias: String) async -> Result + func knockRoom(_ roomID: String, message: String?) async -> Result + + func knockRoomAlias(_ roomAlias: String, message: String?) async -> Result + func uploadMedia(_ media: MediaInfo) async -> Result func roomForIdentifier(_ identifier: String) async -> RoomProxyType? diff --git a/ElementX/Sources/Services/Room/KnockedRoomProxy.swift b/ElementX/Sources/Services/Room/KnockedRoomProxy.swift new file mode 100644 index 0000000000..942baa0412 --- /dev/null +++ b/ElementX/Sources/Services/Room/KnockedRoomProxy.swift @@ -0,0 +1,82 @@ +// +// Copyright 2024 New Vector Ltd. +// +// SPDX-License-Identifier: AGPL-3.0-only +// Please see LICENSE in the repository root for full details. +// + +import Foundation +import MatrixRustSDK +import UIKit + +class KnockedRoomProxy: KnockedRoomProxyProtocol { + private let roomListItem: RoomListItemProtocol + private let room: RoomProtocol + + // A room identifier is constant and lazy stops it from being fetched + // multiple times over FFI + lazy var id: String = room.id() + + var canonicalAlias: String? { + room.canonicalAlias() + } + + var ownUserID: String { + room.ownUserId() + } + + var name: String? { + roomListItem.displayName() + } + + var topic: String? { + room.topic() + } + + var avatarURL: URL? { + roomListItem.avatarUrl().flatMap(URL.init(string:)) + } + + var avatar: RoomAvatar { + if isDirect, avatarURL == nil { + let heroes = room.heroes() + + if heroes.count == 1 { + return .heroes(heroes.map(UserProfileProxy.init)) + } + } + + return .room(id: id, name: name, avatarURL: avatarURL) + } + + var isDirect: Bool { + room.isDirect() + } + + var isPublic: Bool { + room.isPublic() + } + + var isSpace: Bool { + room.isSpace() + } + + var joinedMembersCount: Int { + Int(room.joinedMembersCount()) + } + + var activeMembersCount: Int { + Int(room.activeMembersCount()) + } + + init(roomListItem: RoomListItemProtocol, + room: RoomProtocol) { + self.roomListItem = roomListItem + self.room = room + } + + func cancelKnock() async -> Result { + // TODO: Implement this once the API is available + .failure(.invalidURL) + } +} diff --git a/ElementX/Sources/Services/Room/RoomProxyProtocol.swift b/ElementX/Sources/Services/Room/RoomProxyProtocol.swift index 552e0484d6..46cc11f080 100644 --- a/ElementX/Sources/Services/Room/RoomProxyProtocol.swift +++ b/ElementX/Sources/Services/Room/RoomProxyProtocol.swift @@ -21,6 +21,7 @@ enum RoomProxyError: Error { enum RoomProxyType { case joined(JoinedRoomProxyProtocol) case invited(InvitedRoomProxyProtocol) + case knocked(KnockedRoomProxyProtocol) case left } @@ -56,6 +57,11 @@ protocol InvitedRoomProxyProtocol: RoomProxyProtocol { func acceptInvitation() async -> Result } +// sourcery: AutoMockable +protocol KnockedRoomProxyProtocol: RoomProxyProtocol { + func cancelKnock() async -> Result +} + enum JoinedRoomProxyAction: Equatable { case roomInfoUpdate } diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-en-GB.Knocked.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-en-GB.Knocked.png new file mode 100644 index 0000000000..16efb5ef59 --- /dev/null +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-en-GB.Knocked.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:79f1c8ea20c6791a7d25d8fc18f45d1d0fef989b8fa0316c5b312bfc9dd4c271 +size 1972382 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-pseudo.Knocked.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-pseudo.Knocked.png new file mode 100644 index 0000000000..65181a2704 --- /dev/null +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-pseudo.Knocked.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d159ef72270668acb4ffe1443954086a895e630d5809ff51a65b9302ada8ca89 +size 1988527 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-en-GB.Knocked.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-en-GB.Knocked.png new file mode 100644 index 0000000000..4e8d7e6c1c --- /dev/null +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-en-GB.Knocked.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4e0a6de1d32f7d2845bf66ae655ac2b7404083a6d3478f96e1eea29f0b102e51 +size 811030 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-pseudo.Knocked.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-pseudo.Knocked.png new file mode 100644 index 0000000000..daca3b20bf --- /dev/null +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-pseudo.Knocked.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3e8581d10df35158cd98cc36e23f1ca1ad38659732699bd7073f92aa4331e847 +size 828204 diff --git a/UnitTests/Sources/JoinRoomScreenViewModelTests.swift b/UnitTests/Sources/JoinRoomScreenViewModelTests.swift index c0a0984cee..42b1b6a526 100644 --- a/UnitTests/Sources/JoinRoomScreenViewModelTests.swift +++ b/UnitTests/Sources/JoinRoomScreenViewModelTests.swift @@ -16,6 +16,11 @@ class JoinRoomScreenViewModelTests: XCTestCase { var context: JoinRoomScreenViewModelType.Context { viewModel.context } + + override func tearDown() { + viewModel = nil + AppSettings.resetAllSettings() + } func testInteraction() async throws { setupViewModel() @@ -43,7 +48,15 @@ class JoinRoomScreenViewModelTests: XCTestCase { XCTAssertEqual(viewModel.context.alertInfo?.id, .declineInvite) } - private func setupViewModel(throwing: Bool = false) { + func testKnockedState() async throws { + setupViewModel(knocked: true) + + try await deferFulfillment(viewModel.context.$viewState) { state in + state.mode == .knocked + }.fulfill() + } + + private func setupViewModel(throwing: Bool = false, knocked: Bool = false) { let clientProxy = ClientProxyMock(.init()) clientProxy.joinRoomViaReturnValue = throwing ? .failure(.sdkError(ClientProxyMockError.generic)) : .success(()) @@ -60,8 +73,17 @@ class JoinRoomScreenViewModelTests: XCTestCase { isPublic: false, canKnock: false)) + if knocked { + clientProxy.roomForIdentifierClosure = { _ in + .knocked(KnockedRoomProxyMock(.init())) + } + } + + ServiceLocator.shared.settings.knockingEnabled = true + viewModel = JoinRoomScreenViewModel(roomID: "1", via: [], + appSettings: ServiceLocator.shared.settings, clientProxy: clientProxy, mediaProvider: MediaProviderMock(configuration: .init()), userIndicatorController: ServiceLocator.shared.userIndicatorController) From d995e87b4e106e31fd3a066d2be56c66008663a8 Mon Sep 17 00:00:00 2001 From: Mauro Romito Date: Wed, 16 Oct 2024 19:05:40 +0200 Subject: [PATCH 05/20] send knock request --- .../Screens/JoinRoomScreen/JoinRoomScreenViewModel.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenViewModel.swift b/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenViewModel.swift index b8c64349ff..97cae4291a 100644 --- a/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenViewModel.swift +++ b/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenViewModel.swift @@ -51,7 +51,7 @@ class JoinRoomScreenViewModel: JoinRoomScreenViewModelType, JoinRoomScreenViewMo switch viewAction { case .knock: - break + Task { await knockRoom() } case .join: Task { await joinRoom() } case .acceptInvite: From acfb954885c73762c62389f55f211366a6334555 Mon Sep 17 00:00:00 2001 From: Mauro <34335419+Velin92@users.noreply.github.com> Date: Thu, 17 Oct 2024 12:30:27 +0200 Subject: [PATCH 06/20] Apply suggestions from code review Co-authored-by: Doug <6060466+pixlwave@users.noreply.github.com> --- ElementX/Sources/Mocks/KnockedRoomProxyMock.swift | 2 +- .../Screens/JoinRoomScreen/View/JoinRoomScreen.swift | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/ElementX/Sources/Mocks/KnockedRoomProxyMock.swift b/ElementX/Sources/Mocks/KnockedRoomProxyMock.swift index 3fc2e5e387..610e975a57 100644 --- a/ElementX/Sources/Mocks/KnockedRoomProxyMock.swift +++ b/ElementX/Sources/Mocks/KnockedRoomProxyMock.swift @@ -22,7 +22,7 @@ extension KnockedRoomProxyMock { self.init() id = configuration.id name = configuration.name - avatarURL = avatarURL + avatarURL = configuration.avatarURL avatar = .room(id: configuration.id, name: configuration.name, avatarURL: configuration.avatarURL) // Note: This doesn't replicate the real proxy logic. activeMembersCount = configuration.members.filter { $0.membership == .join || $0.membership == .invite }.count } diff --git a/ElementX/Sources/Screens/JoinRoomScreen/View/JoinRoomScreen.swift b/ElementX/Sources/Screens/JoinRoomScreen/View/JoinRoomScreen.swift index 46f4d1c92d..fb83492752 100644 --- a/ElementX/Sources/Screens/JoinRoomScreen/View/JoinRoomScreen.swift +++ b/ElementX/Sources/Screens/JoinRoomScreen/View/JoinRoomScreen.swift @@ -78,9 +78,8 @@ struct JoinRoomScreen: View { } if context.viewState.mode == .knock { - Spacer() - .frame(height: 19) knockMessage + .padding(.top, 19) } } } @@ -118,9 +117,11 @@ struct JoinRoomScreen: View { } .background(.compound.bgCanvasDefault) .cornerRadius(8) - .overlay(RoundedRectangle(cornerRadius: 8) - .inset(by: 0.5) - .stroke(.compound.borderInteractivePrimary)) + .overlay { + RoundedRectangle(cornerRadius: 8) + .inset(by: 0.5) + .stroke(.compound.borderInteractivePrimary) + } Text(L10n.screenJoinRoomKnockMessageDescription) .font(.compound.bodyMD) From 377ed813a1dc208a78aaf9a50ba403d67699907a Mon Sep 17 00:00:00 2001 From: Mauro Romito Date: Thu, 17 Oct 2024 12:57:01 +0200 Subject: [PATCH 07/20] pr comments --- .../Sources/FlowCoordinators/RoomFlowCoordinator.swift | 3 ++- ElementX/Sources/Other/Extensions/String.swift | 7 +++++++ .../JoinRoomScreen/JoinRoomScreenCoordinator.swift | 3 ++- .../Screens/JoinRoomScreen/JoinRoomScreenModels.swift | 4 ---- .../JoinRoomScreen/JoinRoomScreenViewModel.swift | 10 +++------- 5 files changed, 14 insertions(+), 13 deletions(-) diff --git a/ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift b/ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift index 1c10cdbc56..5eabe89580 100644 --- a/ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift +++ b/ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift @@ -662,7 +662,8 @@ class RoomFlowCoordinator: FlowCoordinatorProtocol { via: via, clientProxy: userSession.clientProxy, mediaProvider: userSession.mediaProvider, - userIndicatorController: userIndicatorController)) + userIndicatorController: userIndicatorController, + appSettings: appSettings)) joinRoomScreenCoordinator = coordinator diff --git a/ElementX/Sources/Other/Extensions/String.swift b/ElementX/Sources/Other/Extensions/String.swift index 58caff4888..2e27561a2e 100644 --- a/ElementX/Sources/Other/Extensions/String.swift +++ b/ElementX/Sources/Other/Extensions/String.swift @@ -90,3 +90,10 @@ extension String { return result } } + +extension String { + /// detects if the string is empty or contains only whitespaces and newlines + var isBlank: Bool { + trimmingCharacters(in: .whitespacesAndNewlines).isEmpty + } +} diff --git a/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenCoordinator.swift b/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenCoordinator.swift index 2d9e0d2ceb..fbe2e23c0d 100644 --- a/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenCoordinator.swift +++ b/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenCoordinator.swift @@ -14,6 +14,7 @@ struct JoinRoomScreenCoordinatorParameters { let clientProxy: ClientProxyProtocol let mediaProvider: MediaProviderProtocol let userIndicatorController: UserIndicatorControllerProtocol + let appSettings: AppSettings } enum JoinRoomScreenCoordinatorAction { @@ -34,7 +35,7 @@ final class JoinRoomScreenCoordinator: CoordinatorProtocol { init(parameters: JoinRoomScreenCoordinatorParameters) { viewModel = JoinRoomScreenViewModel(roomID: parameters.roomID, via: parameters.via, - appSettings: ServiceLocator.shared.settings, + appSettings: parameters.appSettings, clientProxy: parameters.clientProxy, mediaProvider: parameters.mediaProvider, userIndicatorController: parameters.userIndicatorController) diff --git a/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenModels.swift b/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenModels.swift index 44d23c228b..a0bf1d91c6 100644 --- a/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenModels.swift +++ b/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenModels.swift @@ -56,10 +56,6 @@ struct JoinRoomScreenViewState: BindableState { var avatar: RoomAvatar { roomDetails?.avatar ?? .room(id: roomID, name: title, avatarURL: nil) } - - var isEmptyKnockMessage: Bool { - bindings.knockMessage.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty - } } struct JoinRoomScreenViewStateBindings { diff --git a/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenViewModel.swift b/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenViewModel.swift index 97cae4291a..5088efa29f 100644 --- a/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenViewModel.swift +++ b/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenViewModel.swift @@ -143,13 +143,9 @@ class JoinRoomScreenViewModel: JoinRoomScreenViewModelType, JoinRoomScreenViewMo return } - if roomPreviewDetails?.isPublic ?? false { - state.mode = .join - } else if roomPreviewDetails?.canKnock ?? false, appSettings.knockingEnabled { + if roomPreviewDetails?.canKnock ?? false, appSettings.knockingEnabled { state.mode = .knock } else { - // If everything else fails fallback to showing the join button and - // letting the server figure it out. state.mode = .join } } @@ -190,7 +186,7 @@ class JoinRoomScreenViewModel: JoinRoomScreenViewModelType, JoinRoomScreenViewMo if let alias = state.roomDetails?.canonicalAlias { switch await clientProxy.knockRoomAlias(alias, - message: state.isEmptyKnockMessage ? nil : state.bindings.knockMessage) { + message: state.bindings.knockMessage.isBlank ? nil : state.bindings.knockMessage) { case .success: state.mode = .knocked case .failure(let error): @@ -199,7 +195,7 @@ class JoinRoomScreenViewModel: JoinRoomScreenViewModelType, JoinRoomScreenViewMo } } else { switch await clientProxy.knockRoom(roomID, - message: state.isEmptyKnockMessage ? nil : state.bindings.knockMessage) { + message: state.bindings.knockMessage.isBlank ? nil : state.bindings.knockMessage) { case .success: state.mode = .knocked case .failure(let error): From d55ce427e763a29ff38fc6684ec1f48267174641 Mon Sep 17 00:00:00 2001 From: Mauro Romito Date: Thu, 17 Oct 2024 15:16:03 +0200 Subject: [PATCH 08/20] update tests --- .../PreviewTests/test_joinRoomScreen-iPad-en-GB.Knock.png | 4 ++-- .../PreviewTests/test_joinRoomScreen-iPad-pseudo.Knock.png | 4 ++-- .../test_joinRoomScreen-iPhone-16-en-GB.Knock.png | 4 ++-- .../test_joinRoomScreen-iPhone-16-pseudo.Knock.png | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-en-GB.Knock.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-en-GB.Knock.png index 84559893b7..3b61214cdc 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-en-GB.Knock.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-en-GB.Knock.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:74053afd3062c5e8b6c09ef420ec590ec429fc908b465e4f72d8dffe7cf34c60 -size 1787832 +oid sha256:adb3e3a08681e2febea9cd377862eededc6b576bfe06c753bf075eb886f55f9f +size 1788568 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-pseudo.Knock.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-pseudo.Knock.png index ca99716e25..d34ffa65c4 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-pseudo.Knock.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-pseudo.Knock.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2f0d4419f5cc74e3cc298002779c99729181ba929020c5717d7def92ded491d8 -size 1796287 +oid sha256:338b8be69ace718a2796101e2ccfbe93dca412e299279a6078b785fec10e7e4b +size 1797161 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-en-GB.Knock.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-en-GB.Knock.png index 49f652ceac..f0f6bd47a8 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-en-GB.Knock.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-en-GB.Knock.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e195355501280ad576a31e05499b6a6e1eb251e9f711e2e37df249159ab577ea -size 700519 +oid sha256:0be47f8b5c89c0d03e4713e32686c457452851ccc246bf4588f5cb5f82fdbabc +size 701611 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-pseudo.Knock.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-pseudo.Knock.png index 8700315e07..999c04fe9b 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-pseudo.Knock.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-pseudo.Knock.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ce7c84f3afc25ecee477b9df120b28d162060035678fc05f61bd0a0dcc8d7312 -size 708952 +oid sha256:471ae5bf707a3f9e91b7f8cea098287bb21d618297d027a72c105575b5049ff8 +size 709284 From 310c0fbd68691fb31c33c8c84c8f928044d07281 Mon Sep 17 00:00:00 2001 From: Mauro Romito Date: Fri, 18 Oct 2024 13:21:21 +0200 Subject: [PATCH 09/20] new API --- .../Mocks/Generated/GeneratedMocks.swift | 48 +++++----- .../Mocks/Generated/SDKGeneratedMocks.swift | 87 +++++++------------ .../JoinRoomScreenViewModel.swift | 3 +- .../Sources/Services/Client/ClientProxy.swift | 8 +- .../Services/Client/ClientProxyProtocol.swift | 2 +- .../Services/Timeline/TimelineProxy.swift | 16 ++-- .../Timeline/TimelineProxyProtocol.swift | 1 - 7 files changed, 65 insertions(+), 100 deletions(-) diff --git a/ElementX/Sources/Mocks/Generated/GeneratedMocks.swift b/ElementX/Sources/Mocks/Generated/GeneratedMocks.swift index 039932ee7f..f2950f2ae6 100644 --- a/ElementX/Sources/Mocks/Generated/GeneratedMocks.swift +++ b/ElementX/Sources/Mocks/Generated/GeneratedMocks.swift @@ -2837,15 +2837,15 @@ class ClientProxyMock: ClientProxyProtocol { } //MARK: - knockRoom - var knockRoomMessageUnderlyingCallsCount = 0 - var knockRoomMessageCallsCount: Int { + var knockRoomMessageViaUnderlyingCallsCount = 0 + var knockRoomMessageViaCallsCount: Int { get { if Thread.isMainThread { - return knockRoomMessageUnderlyingCallsCount + return knockRoomMessageViaUnderlyingCallsCount } else { var returnValue: Int? = nil DispatchQueue.main.sync { - returnValue = knockRoomMessageUnderlyingCallsCount + returnValue = knockRoomMessageViaUnderlyingCallsCount } return returnValue! @@ -2853,29 +2853,29 @@ class ClientProxyMock: ClientProxyProtocol { } set { if Thread.isMainThread { - knockRoomMessageUnderlyingCallsCount = newValue + knockRoomMessageViaUnderlyingCallsCount = newValue } else { DispatchQueue.main.sync { - knockRoomMessageUnderlyingCallsCount = newValue + knockRoomMessageViaUnderlyingCallsCount = newValue } } } } - var knockRoomMessageCalled: Bool { - return knockRoomMessageCallsCount > 0 + var knockRoomMessageViaCalled: Bool { + return knockRoomMessageViaCallsCount > 0 } - var knockRoomMessageReceivedArguments: (roomID: String, message: String?)? - var knockRoomMessageReceivedInvocations: [(roomID: String, message: String?)] = [] + var knockRoomMessageViaReceivedArguments: (roomID: String, message: String?, via: [String])? + var knockRoomMessageViaReceivedInvocations: [(roomID: String, message: String?, via: [String])] = [] - var knockRoomMessageUnderlyingReturnValue: Result! - var knockRoomMessageReturnValue: Result! { + var knockRoomMessageViaUnderlyingReturnValue: Result! + var knockRoomMessageViaReturnValue: Result! { get { if Thread.isMainThread { - return knockRoomMessageUnderlyingReturnValue + return knockRoomMessageViaUnderlyingReturnValue } else { var returnValue: Result? = nil DispatchQueue.main.sync { - returnValue = knockRoomMessageUnderlyingReturnValue + returnValue = knockRoomMessageViaUnderlyingReturnValue } return returnValue! @@ -2883,26 +2883,26 @@ class ClientProxyMock: ClientProxyProtocol { } set { if Thread.isMainThread { - knockRoomMessageUnderlyingReturnValue = newValue + knockRoomMessageViaUnderlyingReturnValue = newValue } else { DispatchQueue.main.sync { - knockRoomMessageUnderlyingReturnValue = newValue + knockRoomMessageViaUnderlyingReturnValue = newValue } } } } - var knockRoomMessageClosure: ((String, String?) async -> Result)? + var knockRoomMessageViaClosure: ((String, String?, [String]) async -> Result)? - func knockRoom(_ roomID: String, message: String?) async -> Result { - knockRoomMessageCallsCount += 1 - knockRoomMessageReceivedArguments = (roomID: roomID, message: message) + func knockRoom(_ roomID: String, message: String?, via: [String]) async -> Result { + knockRoomMessageViaCallsCount += 1 + knockRoomMessageViaReceivedArguments = (roomID: roomID, message: message, via: via) DispatchQueue.main.async { - self.knockRoomMessageReceivedInvocations.append((roomID: roomID, message: message)) + self.knockRoomMessageViaReceivedInvocations.append((roomID: roomID, message: message, via: via)) } - if let knockRoomMessageClosure = knockRoomMessageClosure { - return await knockRoomMessageClosure(roomID, message) + if let knockRoomMessageViaClosure = knockRoomMessageViaClosure { + return await knockRoomMessageViaClosure(roomID, message, via) } else { - return knockRoomMessageReturnValue + return knockRoomMessageViaReturnValue } } //MARK: - knockRoomAlias diff --git a/ElementX/Sources/Mocks/Generated/SDKGeneratedMocks.swift b/ElementX/Sources/Mocks/Generated/SDKGeneratedMocks.swift index 52c51b578b..e9fa1ed9a0 100644 --- a/ElementX/Sources/Mocks/Generated/SDKGeneratedMocks.swift +++ b/ElementX/Sources/Mocks/Generated/SDKGeneratedMocks.swift @@ -2208,16 +2208,16 @@ open class ClientSDKMock: MatrixRustSDK.Client { //MARK: - knock - open var knockRoomIdOrAliasThrowableError: Error? - var knockRoomIdOrAliasUnderlyingCallsCount = 0 - open var knockRoomIdOrAliasCallsCount: Int { + open var knockRoomIdOrAliasReasonServerNamesThrowableError: Error? + var knockRoomIdOrAliasReasonServerNamesUnderlyingCallsCount = 0 + open var knockRoomIdOrAliasReasonServerNamesCallsCount: Int { get { if Thread.isMainThread { - return knockRoomIdOrAliasUnderlyingCallsCount + return knockRoomIdOrAliasReasonServerNamesUnderlyingCallsCount } else { var returnValue: Int? = nil DispatchQueue.main.sync { - returnValue = knockRoomIdOrAliasUnderlyingCallsCount + returnValue = knockRoomIdOrAliasReasonServerNamesUnderlyingCallsCount } return returnValue! @@ -2225,29 +2225,29 @@ open class ClientSDKMock: MatrixRustSDK.Client { } set { if Thread.isMainThread { - knockRoomIdOrAliasUnderlyingCallsCount = newValue + knockRoomIdOrAliasReasonServerNamesUnderlyingCallsCount = newValue } else { DispatchQueue.main.sync { - knockRoomIdOrAliasUnderlyingCallsCount = newValue + knockRoomIdOrAliasReasonServerNamesUnderlyingCallsCount = newValue } } } } - open var knockRoomIdOrAliasCalled: Bool { - return knockRoomIdOrAliasCallsCount > 0 + open var knockRoomIdOrAliasReasonServerNamesCalled: Bool { + return knockRoomIdOrAliasReasonServerNamesCallsCount > 0 } - open var knockRoomIdOrAliasReceivedRoomIdOrAlias: String? - open var knockRoomIdOrAliasReceivedInvocations: [String] = [] + open var knockRoomIdOrAliasReasonServerNamesReceivedArguments: (roomIdOrAlias: String, reason: String?, serverNames: [String])? + open var knockRoomIdOrAliasReasonServerNamesReceivedInvocations: [(roomIdOrAlias: String, reason: String?, serverNames: [String])] = [] - var knockRoomIdOrAliasUnderlyingReturnValue: Room! - open var knockRoomIdOrAliasReturnValue: Room! { + var knockRoomIdOrAliasReasonServerNamesUnderlyingReturnValue: Room! + open var knockRoomIdOrAliasReasonServerNamesReturnValue: Room! { get { if Thread.isMainThread { - return knockRoomIdOrAliasUnderlyingReturnValue + return knockRoomIdOrAliasReasonServerNamesUnderlyingReturnValue } else { var returnValue: Room? = nil DispatchQueue.main.sync { - returnValue = knockRoomIdOrAliasUnderlyingReturnValue + returnValue = knockRoomIdOrAliasReasonServerNamesUnderlyingReturnValue } return returnValue! @@ -2255,29 +2255,29 @@ open class ClientSDKMock: MatrixRustSDK.Client { } set { if Thread.isMainThread { - knockRoomIdOrAliasUnderlyingReturnValue = newValue + knockRoomIdOrAliasReasonServerNamesUnderlyingReturnValue = newValue } else { DispatchQueue.main.sync { - knockRoomIdOrAliasUnderlyingReturnValue = newValue + knockRoomIdOrAliasReasonServerNamesUnderlyingReturnValue = newValue } } } } - open var knockRoomIdOrAliasClosure: ((String) async throws -> Room)? + open var knockRoomIdOrAliasReasonServerNamesClosure: ((String, String?, [String]) async throws -> Room)? - open override func knock(roomIdOrAlias: String) async throws -> Room { - if let error = knockRoomIdOrAliasThrowableError { + open override func knock(roomIdOrAlias: String, reason: String?, serverNames: [String]) async throws -> Room { + if let error = knockRoomIdOrAliasReasonServerNamesThrowableError { throw error } - knockRoomIdOrAliasCallsCount += 1 - knockRoomIdOrAliasReceivedRoomIdOrAlias = roomIdOrAlias + knockRoomIdOrAliasReasonServerNamesCallsCount += 1 + knockRoomIdOrAliasReasonServerNamesReceivedArguments = (roomIdOrAlias: roomIdOrAlias, reason: reason, serverNames: serverNames) DispatchQueue.main.async { - self.knockRoomIdOrAliasReceivedInvocations.append(roomIdOrAlias) + self.knockRoomIdOrAliasReasonServerNamesReceivedInvocations.append((roomIdOrAlias: roomIdOrAlias, reason: reason, serverNames: serverNames)) } - if let knockRoomIdOrAliasClosure = knockRoomIdOrAliasClosure { - return try await knockRoomIdOrAliasClosure(roomIdOrAlias) + if let knockRoomIdOrAliasReasonServerNamesClosure = knockRoomIdOrAliasReasonServerNamesClosure { + return try await knockRoomIdOrAliasReasonServerNamesClosure(roomIdOrAlias, reason, serverNames) } else { - return knockRoomIdOrAliasReturnValue + return knockRoomIdOrAliasReasonServerNamesReturnValue } } @@ -18042,34 +18042,9 @@ open class TimelineSDKMock: MatrixRustSDK.Timeline { } open var editEventOrTransactionIdNewContentReceivedArguments: (eventOrTransactionId: EventOrTransactionId, newContent: EditedContent)? open var editEventOrTransactionIdNewContentReceivedInvocations: [(eventOrTransactionId: EventOrTransactionId, newContent: EditedContent)] = [] + open var editEventOrTransactionIdNewContentClosure: ((EventOrTransactionId, EditedContent) async throws -> Void)? - var editEventOrTransactionIdNewContentUnderlyingReturnValue: Bool! - open var editEventOrTransactionIdNewContentReturnValue: Bool! { - get { - if Thread.isMainThread { - return editEventOrTransactionIdNewContentUnderlyingReturnValue - } else { - var returnValue: Bool? = nil - DispatchQueue.main.sync { - returnValue = editEventOrTransactionIdNewContentUnderlyingReturnValue - } - - return returnValue! - } - } - set { - if Thread.isMainThread { - editEventOrTransactionIdNewContentUnderlyingReturnValue = newValue - } else { - DispatchQueue.main.sync { - editEventOrTransactionIdNewContentUnderlyingReturnValue = newValue - } - } - } - } - open var editEventOrTransactionIdNewContentClosure: ((EventOrTransactionId, EditedContent) async throws -> Bool)? - - open override func edit(eventOrTransactionId: EventOrTransactionId, newContent: EditedContent) async throws -> Bool { + open override func edit(eventOrTransactionId: EventOrTransactionId, newContent: EditedContent) async throws { if let error = editEventOrTransactionIdNewContentThrowableError { throw error } @@ -18078,11 +18053,7 @@ open class TimelineSDKMock: MatrixRustSDK.Timeline { DispatchQueue.main.async { self.editEventOrTransactionIdNewContentReceivedInvocations.append((eventOrTransactionId: eventOrTransactionId, newContent: newContent)) } - if let editEventOrTransactionIdNewContentClosure = editEventOrTransactionIdNewContentClosure { - return try await editEventOrTransactionIdNewContentClosure(eventOrTransactionId, newContent) - } else { - return editEventOrTransactionIdNewContentReturnValue - } + try await editEventOrTransactionIdNewContentClosure?(eventOrTransactionId, newContent) } //MARK: - endPoll diff --git a/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenViewModel.swift b/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenViewModel.swift index 5088efa29f..61551cc6fe 100644 --- a/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenViewModel.swift +++ b/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenViewModel.swift @@ -195,7 +195,8 @@ class JoinRoomScreenViewModel: JoinRoomScreenViewModelType, JoinRoomScreenViewMo } } else { switch await clientProxy.knockRoom(roomID, - message: state.bindings.knockMessage.isBlank ? nil : state.bindings.knockMessage) { + message: state.bindings.knockMessage.isBlank ? nil : state.bindings.knockMessage, + via: via) { case .success: state.mode = .knocked case .failure(let error): diff --git a/ElementX/Sources/Services/Client/ClientProxy.swift b/ElementX/Sources/Services/Client/ClientProxy.swift index 06972a1ec7..40d626630d 100644 --- a/ElementX/Sources/Services/Client/ClientProxy.swift +++ b/ElementX/Sources/Services/Client/ClientProxy.swift @@ -415,10 +415,9 @@ class ClientProxy: ClientProxyProtocol { } } - func knockRoom(_ roomID: String, message: String?) async -> Result { + func knockRoom(_ roomID: String, message: String?, via: [String]) async -> Result { do { - // TODO: It should also include a message but the API for is not available yet - let _ = try await client.knock(roomIdOrAlias: roomID) + let _ = try await client.knock(roomIdOrAlias: roomID, reason: message, serverNames: via) await waitForRoomToSync(roomID: roomID, timeout: .seconds(30)) return .success(()) } catch { @@ -429,8 +428,7 @@ class ClientProxy: ClientProxyProtocol { func knockRoomAlias(_ roomAlias: String, message: String?) async -> Result { do { - // TODO: It should also include a message but the API for is not available yet - let room = try await client.knock(roomIdOrAlias: roomAlias) + let room = try await client.knock(roomIdOrAlias: roomAlias, reason: message, serverNames: []) await waitForRoomToSync(roomID: room.id(), timeout: .seconds(30)) return .success(()) } catch { diff --git a/ElementX/Sources/Services/Client/ClientProxyProtocol.swift b/ElementX/Sources/Services/Client/ClientProxyProtocol.swift index aa7663a533..c9d5b15602 100644 --- a/ElementX/Sources/Services/Client/ClientProxyProtocol.swift +++ b/ElementX/Sources/Services/Client/ClientProxyProtocol.swift @@ -145,7 +145,7 @@ protocol ClientProxyProtocol: AnyObject, MediaLoaderProtocol { func joinRoomAlias(_ roomAlias: String) async -> Result - func knockRoom(_ roomID: String, message: String?) async -> Result + func knockRoom(_ roomID: String, message: String?, via: [String]) async -> Result func knockRoomAlias(_ roomAlias: String, message: String?) async -> Result diff --git a/ElementX/Sources/Services/Timeline/TimelineProxy.swift b/ElementX/Sources/Services/Timeline/TimelineProxy.swift index 160eff7911..f2ad0762d4 100644 --- a/ElementX/Sources/Services/Timeline/TimelineProxy.swift +++ b/ElementX/Sources/Services/Timeline/TimelineProxy.swift @@ -166,9 +166,7 @@ final class TimelineProxy: TimelineProxyProtocol { func edit(_ eventOrTransactionID: EventOrTransactionId, newContent: RoomMessageEventContentWithoutRelation) async -> Result { do { - guard try await timeline.edit(eventOrTransactionId: eventOrTransactionID, newContent: .roomMessage(content: newContent)) == true else { - return .failure(.failedEditing) - } + try await timeline.edit(eventOrTransactionId: eventOrTransactionID, newContent: .roomMessage(content: newContent)) MXLog.info("Finished editing timeline item: \(eventOrTransactionID)") @@ -460,13 +458,11 @@ final class TimelineProxy: TimelineProxyProtocol { do { let originalEvent = try await timeline.getEventTimelineItemByEventId(eventId: eventID) - guard try await timeline.edit(eventOrTransactionId: originalEvent.eventOrTransactionId, - newContent: .pollStart(pollData: .init(question: question, - answers: answers, - maxSelections: 1, - pollKind: .init(pollKind: pollKind)))) else { - return .failure(.failedEditing) - } + try await timeline.edit(eventOrTransactionId: originalEvent.eventOrTransactionId, + newContent: .pollStart(pollData: .init(question: question, + answers: answers, + maxSelections: 1, + pollKind: .init(pollKind: pollKind)))) MXLog.info("Finished editing poll with eventID: \(eventID)") diff --git a/ElementX/Sources/Services/Timeline/TimelineProxyProtocol.swift b/ElementX/Sources/Services/Timeline/TimelineProxyProtocol.swift index 9301314132..e1c8b5f6fe 100644 --- a/ElementX/Sources/Services/Timeline/TimelineProxyProtocol.swift +++ b/ElementX/Sources/Services/Timeline/TimelineProxyProtocol.swift @@ -18,7 +18,6 @@ enum TimelineKind { enum TimelineProxyError: Error { case sdkError(Error) - case failedEditing case failedRedacting case failedPaginatingEndReached } From 8dc9fe293c57b11d6b5eb0fb25503257843f0583 Mon Sep 17 00:00:00 2001 From: Mauro Romito Date: Fri, 18 Oct 2024 14:32:54 +0200 Subject: [PATCH 10/20] knock implementation and cancel knock --- .../en.lproj/Localizable.strings | 13 ++++ ElementX/Sources/Generated/Strings.swift | 28 +++++++++ .../JoinRoomScreen/JoinRoomScreenModels.swift | 1 + .../JoinRoomScreenViewModel.swift | 61 +++++++++++++++---- .../JoinRoomScreen/View/JoinRoomScreen.swift | 7 ++- .../Services/Room/KnockedRoomProxy.swift | 8 ++- 6 files changed, 100 insertions(+), 18 deletions(-) diff --git a/ElementX/Resources/Localizations/en.lproj/Localizable.strings b/ElementX/Resources/Localizations/en.lproj/Localizable.strings index 3724e95cab..9b9b71021b 100644 --- a/ElementX/Resources/Localizations/en.lproj/Localizable.strings +++ b/ElementX/Resources/Localizations/en.lproj/Localizable.strings @@ -54,6 +54,7 @@ "action_forgot_password" = "Forgot password?"; "action_forward" = "Forward"; "action_go_back" = "Go back"; +"action_ignore" = "Ignore"; "action_invite" = "Invite"; "action_invite_friends" = "Invite people"; "action_invite_friends_to_app" = "Invite people to %1$@"; @@ -133,6 +134,7 @@ "common_dark" = "Dark"; "common_decryption_error" = "Decryption error"; "common_developer_options" = "Developer options"; +"common_device_id" = "Device ID"; "common_direct_chat" = "Direct chat"; "common_edited_suffix" = "(edited)"; "common_editing" = "Editing"; @@ -226,6 +228,7 @@ "common_username" = "Username"; "common_verification_cancelled" = "Verification cancelled"; "common_verification_complete" = "Verification complete"; +"common_verification_failed" = "Verification failed"; "common_verified" = "Verified"; "common_verify_device" = "Verify device"; "common_video" = "Video"; @@ -343,6 +346,9 @@ "screen_create_room_access_section_knocking_option_description" = "Anyone can ask to join the room but an administrator or a moderator will have to accept the request"; "screen_create_room_access_section_knocking_option_title" = "Ask to join"; "screen_join_room_cancel_knock_action" = "Cancel request"; +"screen_join_room_cancel_knock_alert_confirmation" = "Yes, cancel"; +"screen_join_room_cancel_knock_alert_description" = "Are you sure that you want to cancel your request to join this room?"; +"screen_join_room_cancel_knock_alert_title" = "Cancel request to join"; "screen_join_room_knock_message_description" = "Message (optional)"; "screen_join_room_knock_sent_description" = "You will receive an invite to join the room if your request is accepted."; "screen_join_room_knock_sent_title" = "Request to join sent"; @@ -710,6 +716,8 @@ "screen_room_member_details_unblock_alert_action" = "Unblock"; "screen_room_member_details_unblock_alert_description" = "You'll be able to see all messages from them again."; "screen_room_member_details_unblock_user" = "Unblock user"; +"screen_room_member_details_verify_button_subtitle" = "Use the web app to verify this user."; +"screen_room_member_details_verify_button_title" = "Verify %1$@"; "screen_room_member_list_ban_member_confirmation_action" = "Ban"; "screen_room_member_list_ban_member_confirmation_description" = "They won’t be able to join this room again if invited."; "screen_room_member_list_ban_member_confirmation_title" = "Are you sure you want to ban this member?"; @@ -807,6 +815,7 @@ "screen_session_verification_compare_numbers_title" = "Compare numbers"; "screen_session_verification_complete_subtitle" = "Your new session is now verified. It has access to your encrypted messages, and other users will see it as trusted."; "screen_session_verification_enter_recovery_key" = "Enter recovery key"; +"screen_session_verification_failed_subtitle" = "Either the request timed out, the request was denied, or there was a verification mismatch."; "screen_session_verification_open_existing_session_subtitle" = "Prove it’s you in order to access your encrypted message history."; "screen_session_verification_open_existing_session_title" = "Open an existing session"; "screen_session_verification_positive_button_canceled" = "Retry verification"; @@ -814,6 +823,10 @@ "screen_session_verification_positive_button_verifying_ongoing" = "Waiting to match"; "screen_session_verification_ready_subtitle" = "Compare a unique set of emojis."; "screen_session_verification_request_accepted_subtitle" = "Compare the unique emoji, ensuring they appear in the same order."; +"screen_session_verification_request_details_timestamp" = "Signed in"; +"screen_session_verification_request_footer" = "Only continue if you initiated this verification."; +"screen_session_verification_request_subtitle" = "Verify the other device to keep your message history secure."; +"screen_session_verification_request_title" = "Verification requested"; "screen_session_verification_they_dont_match" = "They don’t match"; "screen_session_verification_they_match" = "They match"; "screen_session_verification_waiting_to_accept_subtitle" = "Accept the request to start the verification process in your other session to continue."; diff --git a/ElementX/Sources/Generated/Strings.swift b/ElementX/Sources/Generated/Strings.swift index 11dfb30e47..0543707297 100644 --- a/ElementX/Sources/Generated/Strings.swift +++ b/ElementX/Sources/Generated/Strings.swift @@ -140,6 +140,8 @@ internal enum L10n { internal static var actionForward: String { return L10n.tr("Localizable", "action_forward") } /// Go back internal static var actionGoBack: String { return L10n.tr("Localizable", "action_go_back") } + /// Ignore + internal static var actionIgnore: String { return L10n.tr("Localizable", "action_ignore") } /// Invite internal static var actionInvite: String { return L10n.tr("Localizable", "action_invite") } /// Invite people @@ -298,6 +300,8 @@ internal enum L10n { internal static var commonDecryptionError: String { return L10n.tr("Localizable", "common_decryption_error") } /// Developer options internal static var commonDeveloperOptions: String { return L10n.tr("Localizable", "common_developer_options") } + /// Device ID + internal static var commonDeviceId: String { return L10n.tr("Localizable", "common_device_id") } /// Direct chat internal static var commonDirectChat: String { return L10n.tr("Localizable", "common_direct_chat") } /// (edited) @@ -502,6 +506,8 @@ internal enum L10n { internal static var commonVerificationCancelled: String { return L10n.tr("Localizable", "common_verification_cancelled") } /// Verification complete internal static var commonVerificationComplete: String { return L10n.tr("Localizable", "common_verification_complete") } + /// Verification failed + internal static var commonVerificationFailed: String { return L10n.tr("Localizable", "common_verification_failed") } /// Verified internal static var commonVerified: String { return L10n.tr("Localizable", "common_verified") } /// Verify device @@ -1191,6 +1197,12 @@ internal enum L10n { } /// Cancel request internal static var screenJoinRoomCancelKnockAction: String { return L10n.tr("Localizable", "screen_join_room_cancel_knock_action") } + /// Yes, cancel + internal static var screenJoinRoomCancelKnockAlertConfirmation: String { return L10n.tr("Localizable", "screen_join_room_cancel_knock_alert_confirmation") } + /// Are you sure that you want to cancel your request to join this room? + internal static var screenJoinRoomCancelKnockAlertDescription: String { return L10n.tr("Localizable", "screen_join_room_cancel_knock_alert_description") } + /// Cancel request to join + internal static var screenJoinRoomCancelKnockAlertTitle: String { return L10n.tr("Localizable", "screen_join_room_cancel_knock_alert_title") } /// Join room internal static var screenJoinRoomJoinAction: String { return L10n.tr("Localizable", "screen_join_room_join_action") } /// Send request to join @@ -1723,6 +1735,12 @@ internal enum L10n { internal static var screenRoomMemberDetailsUnblockAlertDescription: String { return L10n.tr("Localizable", "screen_room_member_details_unblock_alert_description") } /// Unblock user internal static var screenRoomMemberDetailsUnblockUser: String { return L10n.tr("Localizable", "screen_room_member_details_unblock_user") } + /// Use the web app to verify this user. + internal static var screenRoomMemberDetailsVerifyButtonSubtitle: String { return L10n.tr("Localizable", "screen_room_member_details_verify_button_subtitle") } + /// Verify %1$@ + internal static func screenRoomMemberDetailsVerifyButtonTitle(_ p1: Any) -> String { + return L10n.tr("Localizable", "screen_room_member_details_verify_button_title", String(describing: p1)) + } /// Ban internal static var screenRoomMemberListBanMemberConfirmationAction: String { return L10n.tr("Localizable", "screen_room_member_list_ban_member_confirmation_action") } /// They won’t be able to join this room again if invited. @@ -1981,6 +1999,8 @@ internal enum L10n { internal static var screenSessionVerificationCompleteSubtitle: String { return L10n.tr("Localizable", "screen_session_verification_complete_subtitle") } /// Enter recovery key internal static var screenSessionVerificationEnterRecoveryKey: String { return L10n.tr("Localizable", "screen_session_verification_enter_recovery_key") } + /// Either the request timed out, the request was denied, or there was a verification mismatch. + internal static var screenSessionVerificationFailedSubtitle: String { return L10n.tr("Localizable", "screen_session_verification_failed_subtitle") } /// Prove it’s you in order to access your encrypted message history. internal static var screenSessionVerificationOpenExistingSessionSubtitle: String { return L10n.tr("Localizable", "screen_session_verification_open_existing_session_subtitle") } /// Open an existing session @@ -1995,6 +2015,14 @@ internal enum L10n { internal static var screenSessionVerificationReadySubtitle: String { return L10n.tr("Localizable", "screen_session_verification_ready_subtitle") } /// Compare the unique emoji, ensuring they appear in the same order. internal static var screenSessionVerificationRequestAcceptedSubtitle: String { return L10n.tr("Localizable", "screen_session_verification_request_accepted_subtitle") } + /// Signed in + internal static var screenSessionVerificationRequestDetailsTimestamp: String { return L10n.tr("Localizable", "screen_session_verification_request_details_timestamp") } + /// Only continue if you initiated this verification. + internal static var screenSessionVerificationRequestFooter: String { return L10n.tr("Localizable", "screen_session_verification_request_footer") } + /// Verify the other device to keep your message history secure. + internal static var screenSessionVerificationRequestSubtitle: String { return L10n.tr("Localizable", "screen_session_verification_request_subtitle") } + /// Verification requested + internal static var screenSessionVerificationRequestTitle: String { return L10n.tr("Localizable", "screen_session_verification_request_title") } /// They don’t match internal static var screenSessionVerificationTheyDontMatch: String { return L10n.tr("Localizable", "screen_session_verification_they_dont_match") } /// They match diff --git a/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenModels.swift b/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenModels.swift index a0bf1d91c6..cad0b049f2 100644 --- a/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenModels.swift +++ b/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenModels.swift @@ -65,6 +65,7 @@ struct JoinRoomScreenViewStateBindings { enum JoinRoomScreenAlertType { case declineInvite + case cancelKnock } enum JoinRoomScreenViewAction { diff --git a/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenViewModel.swift b/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenViewModel.swift index 61551cc6fe..b0e5a3629d 100644 --- a/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenViewModel.swift +++ b/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenViewModel.swift @@ -59,8 +59,7 @@ class JoinRoomScreenViewModel: JoinRoomScreenViewModelType, JoinRoomScreenViewMo case .declineInvite: showDeclineInviteConfirmationAlert() case .cancelKnock: - // TODO: implement once available - break + showCancelKnockConfirmationAlert() } } @@ -78,15 +77,7 @@ class JoinRoomScreenViewModel: JoinRoomScreenViewModelType, JoinRoomScreenViewMo Task { await updateRoomDetails() } } - // Using only the preview API isn't enough as it's not capable - // of giving us information for non-joined rooms (at least not on synapse) - // See if we known about the room locally and, if so, have that - // take priority over the preview one. - - if let room = await clientProxy.roomForIdentifier(roomID) { - self.room = room - await updateRoomDetails() - } + await updateRoom() switch await clientProxy.roomPreviewForIdentifier(roomID, via: via) { case .success(let roomPreviewDetails): @@ -99,6 +90,17 @@ class JoinRoomScreenViewModel: JoinRoomScreenViewModelType, JoinRoomScreenViewMo } } + private func updateRoom() async { + // Using only the preview API isn't enough as it's not capable + // of giving us information for non-joined rooms (at least not on synapse) + // See if we known about the room locally and, if so, have that + // take priority over the preview one. + if let room = await clientProxy.roomForIdentifier(roomID) { + self.room = room + await updateRoomDetails() + } + } + private func updateRoomDetails() async { var roomProxy: RoomProxyProtocol? var inviter: RoomInviterDetails? @@ -188,7 +190,8 @@ class JoinRoomScreenViewModel: JoinRoomScreenViewModelType, JoinRoomScreenViewMo switch await clientProxy.knockRoomAlias(alias, message: state.bindings.knockMessage.isBlank ? nil : state.bindings.knockMessage) { case .success: - state.mode = .knocked + // The room should become knocked through the sync + await updateRoom() case .failure(let error): MXLog.error("Failed knocking room alias: \(alias) with error: \(error)") userIndicatorController.submitIndicator(.init(title: L10n.errorUnknown)) @@ -198,7 +201,8 @@ class JoinRoomScreenViewModel: JoinRoomScreenViewModelType, JoinRoomScreenViewMo message: state.bindings.knockMessage.isBlank ? nil : state.bindings.knockMessage, via: via) { case .success: - state.mode = .knocked + // The room should become knocked through the sync + await updateRoom() case .failure(let error): MXLog.error("Failed knocking room id: \(roomID) with error: \(error)") userIndicatorController.submitIndicator(.init(title: L10n.errorUnknown)) @@ -206,6 +210,27 @@ class JoinRoomScreenViewModel: JoinRoomScreenViewModelType, JoinRoomScreenViewMo } } + private func cancelKnock() async { + defer { + userIndicatorController.retractIndicatorWithId(roomID) + } + + userIndicatorController.submitIndicator(UserIndicator(id: roomID, type: .modal, title: L10n.commonLoading, persistent: true)) + + guard case let .knocked(roomProxy) = room else { + userIndicatorController.submitIndicator(.init(title: L10n.errorUnknown)) + return + } + + let result = await roomProxy.cancelKnock() + + if case .failure = result { + userIndicatorController.submitIndicator(.init(title: L10n.errorUnknown)) + } else { + await updateRoom() + } + } + private func showDeclineInviteConfirmationAlert() { guard let roomDetails = state.roomDetails else { userIndicatorController.submitIndicator(.init(title: L10n.errorUnknown)) @@ -220,6 +245,14 @@ class JoinRoomScreenViewModel: JoinRoomScreenViewModelType, JoinRoomScreenViewMo secondaryButton: .init(title: L10n.actionDecline, role: .destructive, action: { Task { await self.declineInvite() } })) } + private func showCancelKnockConfirmationAlert() { + state.bindings.alertInfo = .init(id: .cancelKnock, + title: L10n.screenJoinRoomCancelKnockAlertTitle, + message: L10n.screenJoinRoomCancelKnockAlertDescription, + primaryButton: .init(title: L10n.actionNo, role: .cancel, action: nil), + secondaryButton: .init(title: L10n.screenJoinRoomCancelKnockAlertConfirmation, role: .destructive, action: { Task { await self.cancelKnock() } })) + } + private func declineInvite() async { defer { userIndicatorController.retractIndicatorWithId(roomID) @@ -236,6 +269,8 @@ class JoinRoomScreenViewModel: JoinRoomScreenViewModelType, JoinRoomScreenViewMo if case .failure = result { userIndicatorController.submitIndicator(.init(title: L10n.errorUnknown)) + } else { + await updateRoom() } } diff --git a/ElementX/Sources/Screens/JoinRoomScreen/View/JoinRoomScreen.swift b/ElementX/Sources/Screens/JoinRoomScreen/View/JoinRoomScreen.swift index fb83492752..c373c22312 100644 --- a/ElementX/Sources/Screens/JoinRoomScreen/View/JoinRoomScreen.swift +++ b/ElementX/Sources/Screens/JoinRoomScreen/View/JoinRoomScreen.swift @@ -31,9 +31,10 @@ struct JoinRoomScreen: View { @ViewBuilder var mainContent: some View { - if context.viewState.mode == .knocked { + switch context.viewState.mode { + case .knocked: knockedView - } else { + default: defaultView } } @@ -101,7 +102,7 @@ struct JoinRoomScreen: View { } } } - + @ViewBuilder private var knockMessage: some View { VStack(alignment: .leading, spacing: 12) { diff --git a/ElementX/Sources/Services/Room/KnockedRoomProxy.swift b/ElementX/Sources/Services/Room/KnockedRoomProxy.swift index 942baa0412..7ca349f331 100644 --- a/ElementX/Sources/Services/Room/KnockedRoomProxy.swift +++ b/ElementX/Sources/Services/Room/KnockedRoomProxy.swift @@ -76,7 +76,11 @@ class KnockedRoomProxy: KnockedRoomProxyProtocol { } func cancelKnock() async -> Result { - // TODO: Implement this once the API is available - .failure(.invalidURL) + do { + return try await .success(room.leave()) + } catch { + MXLog.error("Failed cancelling the knock with error: \(error)") + return .failure(.sdkError(error)) + } } } From 4869e6587fa1a9c8e11ab5bb4d44d386e4b1e9d9 Mon Sep 17 00:00:00 2001 From: Mauro Romito Date: Fri, 18 Oct 2024 14:36:36 +0200 Subject: [PATCH 11/20] update strings --- .../en.lproj/Localizable.strings | 13 +++++++++ ElementX/Sources/Generated/Strings.swift | 28 +++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/ElementX/Resources/Localizations/en.lproj/Localizable.strings b/ElementX/Resources/Localizations/en.lproj/Localizable.strings index 3724e95cab..9b9b71021b 100644 --- a/ElementX/Resources/Localizations/en.lproj/Localizable.strings +++ b/ElementX/Resources/Localizations/en.lproj/Localizable.strings @@ -54,6 +54,7 @@ "action_forgot_password" = "Forgot password?"; "action_forward" = "Forward"; "action_go_back" = "Go back"; +"action_ignore" = "Ignore"; "action_invite" = "Invite"; "action_invite_friends" = "Invite people"; "action_invite_friends_to_app" = "Invite people to %1$@"; @@ -133,6 +134,7 @@ "common_dark" = "Dark"; "common_decryption_error" = "Decryption error"; "common_developer_options" = "Developer options"; +"common_device_id" = "Device ID"; "common_direct_chat" = "Direct chat"; "common_edited_suffix" = "(edited)"; "common_editing" = "Editing"; @@ -226,6 +228,7 @@ "common_username" = "Username"; "common_verification_cancelled" = "Verification cancelled"; "common_verification_complete" = "Verification complete"; +"common_verification_failed" = "Verification failed"; "common_verified" = "Verified"; "common_verify_device" = "Verify device"; "common_video" = "Video"; @@ -343,6 +346,9 @@ "screen_create_room_access_section_knocking_option_description" = "Anyone can ask to join the room but an administrator or a moderator will have to accept the request"; "screen_create_room_access_section_knocking_option_title" = "Ask to join"; "screen_join_room_cancel_knock_action" = "Cancel request"; +"screen_join_room_cancel_knock_alert_confirmation" = "Yes, cancel"; +"screen_join_room_cancel_knock_alert_description" = "Are you sure that you want to cancel your request to join this room?"; +"screen_join_room_cancel_knock_alert_title" = "Cancel request to join"; "screen_join_room_knock_message_description" = "Message (optional)"; "screen_join_room_knock_sent_description" = "You will receive an invite to join the room if your request is accepted."; "screen_join_room_knock_sent_title" = "Request to join sent"; @@ -710,6 +716,8 @@ "screen_room_member_details_unblock_alert_action" = "Unblock"; "screen_room_member_details_unblock_alert_description" = "You'll be able to see all messages from them again."; "screen_room_member_details_unblock_user" = "Unblock user"; +"screen_room_member_details_verify_button_subtitle" = "Use the web app to verify this user."; +"screen_room_member_details_verify_button_title" = "Verify %1$@"; "screen_room_member_list_ban_member_confirmation_action" = "Ban"; "screen_room_member_list_ban_member_confirmation_description" = "They won’t be able to join this room again if invited."; "screen_room_member_list_ban_member_confirmation_title" = "Are you sure you want to ban this member?"; @@ -807,6 +815,7 @@ "screen_session_verification_compare_numbers_title" = "Compare numbers"; "screen_session_verification_complete_subtitle" = "Your new session is now verified. It has access to your encrypted messages, and other users will see it as trusted."; "screen_session_verification_enter_recovery_key" = "Enter recovery key"; +"screen_session_verification_failed_subtitle" = "Either the request timed out, the request was denied, or there was a verification mismatch."; "screen_session_verification_open_existing_session_subtitle" = "Prove it’s you in order to access your encrypted message history."; "screen_session_verification_open_existing_session_title" = "Open an existing session"; "screen_session_verification_positive_button_canceled" = "Retry verification"; @@ -814,6 +823,10 @@ "screen_session_verification_positive_button_verifying_ongoing" = "Waiting to match"; "screen_session_verification_ready_subtitle" = "Compare a unique set of emojis."; "screen_session_verification_request_accepted_subtitle" = "Compare the unique emoji, ensuring they appear in the same order."; +"screen_session_verification_request_details_timestamp" = "Signed in"; +"screen_session_verification_request_footer" = "Only continue if you initiated this verification."; +"screen_session_verification_request_subtitle" = "Verify the other device to keep your message history secure."; +"screen_session_verification_request_title" = "Verification requested"; "screen_session_verification_they_dont_match" = "They don’t match"; "screen_session_verification_they_match" = "They match"; "screen_session_verification_waiting_to_accept_subtitle" = "Accept the request to start the verification process in your other session to continue."; diff --git a/ElementX/Sources/Generated/Strings.swift b/ElementX/Sources/Generated/Strings.swift index 11dfb30e47..0543707297 100644 --- a/ElementX/Sources/Generated/Strings.swift +++ b/ElementX/Sources/Generated/Strings.swift @@ -140,6 +140,8 @@ internal enum L10n { internal static var actionForward: String { return L10n.tr("Localizable", "action_forward") } /// Go back internal static var actionGoBack: String { return L10n.tr("Localizable", "action_go_back") } + /// Ignore + internal static var actionIgnore: String { return L10n.tr("Localizable", "action_ignore") } /// Invite internal static var actionInvite: String { return L10n.tr("Localizable", "action_invite") } /// Invite people @@ -298,6 +300,8 @@ internal enum L10n { internal static var commonDecryptionError: String { return L10n.tr("Localizable", "common_decryption_error") } /// Developer options internal static var commonDeveloperOptions: String { return L10n.tr("Localizable", "common_developer_options") } + /// Device ID + internal static var commonDeviceId: String { return L10n.tr("Localizable", "common_device_id") } /// Direct chat internal static var commonDirectChat: String { return L10n.tr("Localizable", "common_direct_chat") } /// (edited) @@ -502,6 +506,8 @@ internal enum L10n { internal static var commonVerificationCancelled: String { return L10n.tr("Localizable", "common_verification_cancelled") } /// Verification complete internal static var commonVerificationComplete: String { return L10n.tr("Localizable", "common_verification_complete") } + /// Verification failed + internal static var commonVerificationFailed: String { return L10n.tr("Localizable", "common_verification_failed") } /// Verified internal static var commonVerified: String { return L10n.tr("Localizable", "common_verified") } /// Verify device @@ -1191,6 +1197,12 @@ internal enum L10n { } /// Cancel request internal static var screenJoinRoomCancelKnockAction: String { return L10n.tr("Localizable", "screen_join_room_cancel_knock_action") } + /// Yes, cancel + internal static var screenJoinRoomCancelKnockAlertConfirmation: String { return L10n.tr("Localizable", "screen_join_room_cancel_knock_alert_confirmation") } + /// Are you sure that you want to cancel your request to join this room? + internal static var screenJoinRoomCancelKnockAlertDescription: String { return L10n.tr("Localizable", "screen_join_room_cancel_knock_alert_description") } + /// Cancel request to join + internal static var screenJoinRoomCancelKnockAlertTitle: String { return L10n.tr("Localizable", "screen_join_room_cancel_knock_alert_title") } /// Join room internal static var screenJoinRoomJoinAction: String { return L10n.tr("Localizable", "screen_join_room_join_action") } /// Send request to join @@ -1723,6 +1735,12 @@ internal enum L10n { internal static var screenRoomMemberDetailsUnblockAlertDescription: String { return L10n.tr("Localizable", "screen_room_member_details_unblock_alert_description") } /// Unblock user internal static var screenRoomMemberDetailsUnblockUser: String { return L10n.tr("Localizable", "screen_room_member_details_unblock_user") } + /// Use the web app to verify this user. + internal static var screenRoomMemberDetailsVerifyButtonSubtitle: String { return L10n.tr("Localizable", "screen_room_member_details_verify_button_subtitle") } + /// Verify %1$@ + internal static func screenRoomMemberDetailsVerifyButtonTitle(_ p1: Any) -> String { + return L10n.tr("Localizable", "screen_room_member_details_verify_button_title", String(describing: p1)) + } /// Ban internal static var screenRoomMemberListBanMemberConfirmationAction: String { return L10n.tr("Localizable", "screen_room_member_list_ban_member_confirmation_action") } /// They won’t be able to join this room again if invited. @@ -1981,6 +1999,8 @@ internal enum L10n { internal static var screenSessionVerificationCompleteSubtitle: String { return L10n.tr("Localizable", "screen_session_verification_complete_subtitle") } /// Enter recovery key internal static var screenSessionVerificationEnterRecoveryKey: String { return L10n.tr("Localizable", "screen_session_verification_enter_recovery_key") } + /// Either the request timed out, the request was denied, or there was a verification mismatch. + internal static var screenSessionVerificationFailedSubtitle: String { return L10n.tr("Localizable", "screen_session_verification_failed_subtitle") } /// Prove it’s you in order to access your encrypted message history. internal static var screenSessionVerificationOpenExistingSessionSubtitle: String { return L10n.tr("Localizable", "screen_session_verification_open_existing_session_subtitle") } /// Open an existing session @@ -1995,6 +2015,14 @@ internal enum L10n { internal static var screenSessionVerificationReadySubtitle: String { return L10n.tr("Localizable", "screen_session_verification_ready_subtitle") } /// Compare the unique emoji, ensuring they appear in the same order. internal static var screenSessionVerificationRequestAcceptedSubtitle: String { return L10n.tr("Localizable", "screen_session_verification_request_accepted_subtitle") } + /// Signed in + internal static var screenSessionVerificationRequestDetailsTimestamp: String { return L10n.tr("Localizable", "screen_session_verification_request_details_timestamp") } + /// Only continue if you initiated this verification. + internal static var screenSessionVerificationRequestFooter: String { return L10n.tr("Localizable", "screen_session_verification_request_footer") } + /// Verify the other device to keep your message history secure. + internal static var screenSessionVerificationRequestSubtitle: String { return L10n.tr("Localizable", "screen_session_verification_request_subtitle") } + /// Verification requested + internal static var screenSessionVerificationRequestTitle: String { return L10n.tr("Localizable", "screen_session_verification_request_title") } /// They don’t match internal static var screenSessionVerificationTheyDontMatch: String { return L10n.tr("Localizable", "screen_session_verification_they_dont_match") } /// They match From 2eecc7b77cbdc9ed54e7a72d5527b855908aaa2c Mon Sep 17 00:00:00 2001 From: Mauro Romito Date: Mon, 21 Oct 2024 14:25:35 +0200 Subject: [PATCH 12/20] added a knocked cell in the home screen --- .../en.lproj/Localizable.strings | 1 + ElementX/Sources/Generated/Strings.swift | 2 + .../Mocks/RoomSummaryProviderMock.swift | 18 +- .../Screens/HomeScreen/HomeScreenModels.swift | 13 +- .../View/HomeScreenInviteCell.swift | 4 +- .../View/HomeScreenKnockedCell.swift | 202 ++++++++++++++++++ .../HomeScreen/View/HomeScreenRoomList.swift | 2 + .../JoinRoomScreenViewModel.swift | 42 ++-- .../Sources/Services/Client/ClientProxy.swift | 4 +- .../Room/RoomSummary/RoomSummary.swift | 9 +- .../RoomSummary/RoomSummaryProvider.swift | 8 +- .../Sources/GeneratedPreviewTests.swift | 6 + ...est_homeScreenKnockedCell-iPad-en-GB.1.png | 3 + ...st_homeScreenKnockedCell-iPad-pseudo.1.png | 3 + ...omeScreenKnockedCell-iPhone-16-en-GB.1.png | 3 + ...meScreenKnockedCell-iPhone-16-pseudo.1.png | 3 + UnitTests/Sources/HomeScreenRoomTests.swift | 2 +- .../JoinRoomScreenViewModelTests.swift | 16 +- UnitTests/Sources/LoggingTests.swift | 2 +- UnitTests/Sources/RoomSummaryTests.swift | 2 +- 20 files changed, 301 insertions(+), 44 deletions(-) create mode 100644 ElementX/Sources/Screens/HomeScreen/View/HomeScreenKnockedCell.swift create mode 100644 PreviewTests/Sources/__Snapshots__/PreviewTests/test_homeScreenKnockedCell-iPad-en-GB.1.png create mode 100644 PreviewTests/Sources/__Snapshots__/PreviewTests/test_homeScreenKnockedCell-iPad-pseudo.1.png create mode 100644 PreviewTests/Sources/__Snapshots__/PreviewTests/test_homeScreenKnockedCell-iPhone-16-en-GB.1.png create mode 100644 PreviewTests/Sources/__Snapshots__/PreviewTests/test_homeScreenKnockedCell-iPhone-16-pseudo.1.png diff --git a/ElementX/Resources/Localizations/en.lproj/Localizable.strings b/ElementX/Resources/Localizations/en.lproj/Localizable.strings index 9b9b71021b..26c7bf300c 100644 --- a/ElementX/Resources/Localizations/en.lproj/Localizable.strings +++ b/ElementX/Resources/Localizations/en.lproj/Localizable.strings @@ -352,6 +352,7 @@ "screen_join_room_knock_message_description" = "Message (optional)"; "screen_join_room_knock_sent_description" = "You will receive an invite to join the room if your request is accepted."; "screen_join_room_knock_sent_title" = "Request to join sent"; +"screen_knocked_knock_sent" = "Request to join sent"; "screen_pinned_timeline_empty_state_description" = "Press on a message and choose “%1$@” to include here."; "screen_pinned_timeline_empty_state_headline" = "Pin important messages so that they can be easily discovered"; "screen_reset_encryption_password_error" = "An unknown error happened. Please check your account password is correct and try again."; diff --git a/ElementX/Sources/Generated/Strings.swift b/ElementX/Sources/Generated/Strings.swift index 0543707297..be057bfd0f 100644 --- a/ElementX/Sources/Generated/Strings.swift +++ b/ElementX/Sources/Generated/Strings.swift @@ -1243,6 +1243,8 @@ internal enum L10n { } /// Are you sure you want to turn off backup? internal static var screenKeyBackupDisableTitle: String { return L10n.tr("Localizable", "screen_key_backup_disable_title") } + /// Request to join sent + internal static var screenKnockedKnockSent: String { return L10n.tr("Localizable", "screen_knocked_knock_sent") } /// This account has been deactivated. internal static var screenLoginErrorDeactivatedAccount: String { return L10n.tr("Localizable", "screen_login_error_deactivated_account") } /// Incorrect username and/or password diff --git a/ElementX/Sources/Mocks/RoomSummaryProviderMock.swift b/ElementX/Sources/Mocks/RoomSummaryProviderMock.swift index 7e47548e0f..cdb8dfe919 100644 --- a/ElementX/Sources/Mocks/RoomSummaryProviderMock.swift +++ b/ElementX/Sources/Mocks/RoomSummaryProviderMock.swift @@ -71,7 +71,7 @@ extension Array where Element == RoomSummary { static let mockRooms: [Element] = [ RoomSummary(roomListItem: RoomListItemSDKMock(), id: "1", - isInvite: false, + joinRequestType: nil, inviter: nil, name: "Foundation 🔭🪐🌌", isDirect: false, @@ -89,7 +89,7 @@ extension Array where Element == RoomSummary { isFavourite: false), RoomSummary(roomListItem: RoomListItemSDKMock(), id: "2", - isInvite: false, + joinRequestType: nil, inviter: nil, name: "Foundation and Empire", isDirect: false, @@ -107,7 +107,7 @@ extension Array where Element == RoomSummary { isFavourite: false), RoomSummary(roomListItem: RoomListItemSDKMock(), id: "3", - isInvite: false, + joinRequestType: nil, inviter: nil, name: "Second Foundation", isDirect: false, @@ -125,7 +125,7 @@ extension Array where Element == RoomSummary { isFavourite: false), RoomSummary(roomListItem: RoomListItemSDKMock(), id: "4", - isInvite: false, + joinRequestType: nil, inviter: nil, name: "Foundation's Edge", isDirect: false, @@ -143,7 +143,7 @@ extension Array where Element == RoomSummary { isFavourite: false), RoomSummary(roomListItem: RoomListItemSDKMock(), id: "5", - isInvite: false, + joinRequestType: nil, inviter: nil, name: "Foundation and Earth", isDirect: true, @@ -161,7 +161,7 @@ extension Array where Element == RoomSummary { isFavourite: false), RoomSummary(roomListItem: RoomListItemSDKMock(), id: "6", - isInvite: false, + joinRequestType: nil, inviter: nil, name: "Prelude to Foundation", isDirect: true, @@ -179,7 +179,7 @@ extension Array where Element == RoomSummary { isFavourite: false), RoomSummary(roomListItem: RoomListItemSDKMock(), id: "0", - isInvite: false, + joinRequestType: nil, inviter: nil, name: "Unknown", isDirect: false, @@ -230,7 +230,7 @@ extension Array where Element == RoomSummary { static let mockInvites: [Element] = [ RoomSummary(roomListItem: RoomListItemSDKMock(), id: "someAwesomeRoomId1", - isInvite: false, + joinRequestType: nil, inviter: RoomMemberProxyMock.mockCharlie, name: "First room", isDirect: false, @@ -248,7 +248,7 @@ extension Array where Element == RoomSummary { isFavourite: false), RoomSummary(roomListItem: RoomListItemSDKMock(), id: "someAwesomeRoomId2", - isInvite: false, + joinRequestType: nil, inviter: RoomMemberProxyMock.mockCharlie, name: "Second room", isDirect: true, diff --git a/ElementX/Sources/Screens/HomeScreen/HomeScreenModels.swift b/ElementX/Sources/Screens/HomeScreen/HomeScreenModels.swift index 96106f1ea9..134660cdb0 100644 --- a/ElementX/Sources/Screens/HomeScreen/HomeScreenModels.swift +++ b/ElementX/Sources/Screens/HomeScreen/HomeScreenModels.swift @@ -131,6 +131,7 @@ struct HomeScreenRoom: Identifiable, Equatable { case placeholder case room case invite + case knocked } static let placeholderLastMessage = AttributedString("Hidden last message") @@ -192,17 +193,23 @@ extension HomeScreenRoom { let hasUnreadMessages = hideUnreadMessagesBadge ? false : summary.hasUnreadMessages - let isDotShown = hasUnreadMessages || summary.hasUnreadMentions || summary.hasUnreadNotifications || summary.isMarkedUnread + let isDotShown = hasUnreadMessages || summary.hasUnreadMentions || summary.hasUnreadNotifications || summary.isMarkedUnread || summary.joinRequestType == .knocked let isMentionShown = summary.hasUnreadMentions && !summary.isMuted let isMuteShown = summary.isMuted let isCallShown = summary.hasOngoingCall - let isHighlighted = summary.isMarkedUnread || (!summary.isMuted && (summary.hasUnreadNotifications || summary.hasUnreadMentions)) + let isHighlighted = summary.isMarkedUnread || (!summary.isMuted && (summary.hasUnreadNotifications || summary.hasUnreadMentions)) || summary.joinRequestType == .knocked let inviter = summary.inviter.map(RoomInviterDetails.init) + let type: HomeScreenRoom.RoomType = switch summary.joinRequestType { + case .invite: .invite + case .knocked: .knocked + case .none: .room + } + self.init(id: identifier, roomID: summary.id, - type: summary.isInvite ? .invite : .room, + type: type, badges: .init(isDotShown: isDotShown, isMentionShown: isMentionShown, isMuteShown: isMuteShown, diff --git a/ElementX/Sources/Screens/HomeScreen/View/HomeScreenInviteCell.swift b/ElementX/Sources/Screens/HomeScreen/View/HomeScreenInviteCell.swift index aaf7ca0fad..dd48ffdc9f 100644 --- a/ElementX/Sources/Screens/HomeScreen/View/HomeScreenInviteCell.swift +++ b/ElementX/Sources/Screens/HomeScreen/View/HomeScreenInviteCell.swift @@ -177,7 +177,7 @@ private extension HomeScreenRoom { let summary = RoomSummary(roomListItem: RoomListItemSDKMock(), id: "@someone:somewhere.com", - isInvite: false, + joinRequestType: nil, inviter: inviter, name: "Some Guy", isDirect: true, @@ -205,7 +205,7 @@ private extension HomeScreenRoom { let summary = RoomSummary(roomListItem: RoomListItemSDKMock(), id: "@someone:somewhere.com", - isInvite: false, + joinRequestType: nil, inviter: inviter, name: "Awesome Room", isDirect: false, diff --git a/ElementX/Sources/Screens/HomeScreen/View/HomeScreenKnockedCell.swift b/ElementX/Sources/Screens/HomeScreen/View/HomeScreenKnockedCell.swift new file mode 100644 index 0000000000..c34c15daf0 --- /dev/null +++ b/ElementX/Sources/Screens/HomeScreen/View/HomeScreenKnockedCell.swift @@ -0,0 +1,202 @@ +// +// Copyright 2024 New Vector Ltd. +// +// SPDX-License-Identifier: AGPL-3.0-only +// Please see LICENSE in the repository root for full details. +// + +import Combine +import Compound +import SwiftUI + +@MainActor +struct HomeScreenKnockedCell: View { + @Environment(\.dynamicTypeSize) var dynamicTypeSize + + let room: HomeScreenRoom + let context: HomeScreenViewModel.Context + + var body: some View { + HStack(alignment: .top, spacing: 16) { + if dynamicTypeSize < .accessibility3 { + RoomAvatarImage(avatar: room.avatar, + avatarSize: .custom(52), + mediaProvider: context.mediaProvider) + .dynamicTypeSize(dynamicTypeSize < .accessibility1 ? dynamicTypeSize : .accessibility1) + .accessibilityHidden(true) + } + + mainContent + .frame(maxWidth: .infinity, alignment: .leading) + .padding(.bottom, 16) + .padding(.trailing, 16) + .multilineTextAlignment(.leading) + .overlay(alignment: .bottom) { + separator + } + } + .padding(.top, 12) + .padding(.leading, 16) + .onTapGesture { + if let roomID = room.roomID { + context.send(viewAction: .selectRoom(roomIdentifier: roomID)) + } + } + } + + // MARK: - Private + + private var mainContent: some View { + VStack(alignment: .leading, spacing: 0) { + VStack(alignment: .leading, spacing: 0) { + HStack(alignment: .firstTextBaseline, spacing: 16) { + textualContent + badge + } + + Text(L10n.screenKnockedKnockSent) + .font(.compound.bodyMD) + .foregroundStyle(.compound.textPlaceholder) + .padding(.top, room.canonicalAlias == nil ? 0 : 4) + .padding(.trailing, 16) + } + .fixedSize(horizontal: false, vertical: true) + .accessibilityElement(children: .combine) + } + } + + @ViewBuilder + private var textualContent: some View { + VStack(alignment: .leading, spacing: 0) { + Text(title) + .font(.compound.bodyLGSemibold) + .foregroundColor(.compound.textPrimary) + .lineLimit(2) + + if let subtitle { + Text(subtitle) + .font(.compound.bodyMD) + .foregroundColor(.compound.textPlaceholder) + } + } + .frame(maxWidth: .infinity, alignment: .leading) + } + + private var separator: some View { + Rectangle() + .fill(Color.compound.borderDisabled) + .frame(height: 1 / UIScreen.main.scale) + } + + private var title: String { + room.name + } + + private var subtitle: String? { + room.canonicalAlias + } + + private var badge: some View { + Circle() + .scaledFrame(size: 12) + .foregroundColor(.compound.iconAccentTertiary) + } +} + +struct HomeScreenKnockedCell_Previews: PreviewProvider, TestablePreview { + static var previews: some View { + ScrollView { + VStack(spacing: 0) { + HomeScreenKnockedCell(room: .dmInvite, + context: viewModel().context) + + HomeScreenKnockedCell(room: .dmInvite, + context: viewModel().context) + + HomeScreenKnockedCell(room: .roomKnocked(), + context: viewModel().context) + + HomeScreenKnockedCell(room: .roomKnocked(), + context: viewModel().context) + + HomeScreenKnockedCell(room: .roomKnocked(alias: "#footest:somewhere.org", avatarURL: .picturesDirectory), + context: viewModel().context) + + HomeScreenKnockedCell(room: .roomKnocked(alias: "#footest:somewhere.org"), + context: viewModel().context) + .dynamicTypeSize(.accessibility1) + .previewDisplayName("Aliased room (AX1)") + } + } + } + + static func viewModel() -> HomeScreenViewModel { + let clientProxy = ClientProxyMock(.init()) + + let userSession = UserSessionMock(.init(clientProxy: clientProxy)) + + return HomeScreenViewModel(userSession: userSession, + analyticsService: ServiceLocator.shared.analytics, + appSettings: ServiceLocator.shared.settings, + selectedRoomPublisher: CurrentValueSubject(nil).asCurrentValuePublisher(), + userIndicatorController: ServiceLocator.shared.userIndicatorController) + } +} + +@MainActor +private extension HomeScreenRoom { + static var dmInvite: HomeScreenRoom { + let inviter = RoomMemberProxyMock() + inviter.displayName = "Jack" + inviter.userID = "@jack:somewhere.com" + + let summary = RoomSummary(roomListItem: RoomListItemSDKMock(), + id: "@someone:somewhere.com", + joinRequestType: nil, + inviter: inviter, + name: "Some Guy", + isDirect: true, + avatarURL: nil, + heroes: [.init(userID: "@someone:somewhere.com")], + lastMessage: nil, + lastMessageFormattedTimestamp: nil, + unreadMessagesCount: 0, + unreadMentionsCount: 0, + unreadNotificationsCount: 0, + notificationMode: nil, + canonicalAlias: "#footest:somewhere.org", + hasOngoingCall: false, + isMarkedUnread: false, + isFavourite: false) + + return .init(summary: summary, hideUnreadMessagesBadge: false) + } + + static func roomKnocked(alias: String? = nil, avatarURL: URL? = nil) -> HomeScreenRoom { + let inviter = RoomMemberProxyMock() + inviter.displayName = "Luca" + inviter.userID = "@jack:somewhi.nl" + inviter.avatarURL = avatarURL + + let summary = RoomSummary(roomListItem: RoomListItemSDKMock(), + id: "@someone:somewhere.com", + joinRequestType: nil, + inviter: inviter, + name: "Awesome Room", + isDirect: false, + avatarURL: avatarURL, + heroes: [.init(userID: "@someone:somewhere.com")], + lastMessage: nil, + lastMessageFormattedTimestamp: nil, + unreadMessagesCount: 0, + unreadMentionsCount: 0, + unreadNotificationsCount: 0, + notificationMode: nil, + canonicalAlias: alias, + hasOngoingCall: false, + isMarkedUnread: false, + isFavourite: false) + + return .init(summary: summary, hideUnreadMessagesBadge: false) + } +} diff --git a/ElementX/Sources/Screens/HomeScreen/View/HomeScreenRoomList.swift b/ElementX/Sources/Screens/HomeScreen/View/HomeScreenRoomList.swift index 393b5c7227..066644a4b3 100644 --- a/ElementX/Sources/Screens/HomeScreen/View/HomeScreenRoomList.swift +++ b/ElementX/Sources/Screens/HomeScreen/View/HomeScreenRoomList.swift @@ -32,6 +32,8 @@ struct HomeScreenRoomList: View { .redacted(reason: .placeholder) case .invite: HomeScreenInviteCell(room: room, context: context) + case .knocked: + HomeScreenKnockedCell(room: room, context: context) case .room: let isSelected = context.viewState.selectedRoomID == room.id diff --git a/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenViewModel.swift b/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenViewModel.swift index b0e5a3629d..289459a290 100644 --- a/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenViewModel.swift +++ b/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenViewModel.swift @@ -210,27 +210,6 @@ class JoinRoomScreenViewModel: JoinRoomScreenViewModelType, JoinRoomScreenViewMo } } - private func cancelKnock() async { - defer { - userIndicatorController.retractIndicatorWithId(roomID) - } - - userIndicatorController.submitIndicator(UserIndicator(id: roomID, type: .modal, title: L10n.commonLoading, persistent: true)) - - guard case let .knocked(roomProxy) = room else { - userIndicatorController.submitIndicator(.init(title: L10n.errorUnknown)) - return - } - - let result = await roomProxy.cancelKnock() - - if case .failure = result { - userIndicatorController.submitIndicator(.init(title: L10n.errorUnknown)) - } else { - await updateRoom() - } - } - private func showDeclineInviteConfirmationAlert() { guard let roomDetails = state.roomDetails else { userIndicatorController.submitIndicator(.init(title: L10n.errorUnknown)) @@ -274,6 +253,27 @@ class JoinRoomScreenViewModel: JoinRoomScreenViewModelType, JoinRoomScreenViewMo } } + private func cancelKnock() async { + defer { + userIndicatorController.retractIndicatorWithId(roomID) + } + + userIndicatorController.submitIndicator(UserIndicator(id: roomID, type: .modal, title: L10n.commonLoading, persistent: true)) + + guard case let .knocked(roomProxy) = room else { + userIndicatorController.submitIndicator(.init(title: L10n.errorUnknown)) + return + } + + let result = await roomProxy.cancelKnock() + + if case .failure = result { + userIndicatorController.submitIndicator(.init(title: L10n.errorUnknown)) + } else { + await updateRoom() + } + } + private static let loadingIndicatorIdentifier = "\(JoinRoomScreenViewModel.self)-Loading" private func showLoadingIndicator() { diff --git a/ElementX/Sources/Services/Client/ClientProxy.swift b/ElementX/Sources/Services/Client/ClientProxy.swift index 40d626630d..59b890ff84 100644 --- a/ElementX/Sources/Services/Client/ClientProxy.swift +++ b/ElementX/Sources/Services/Client/ClientProxy.swift @@ -417,7 +417,7 @@ class ClientProxy: ClientProxyProtocol { func knockRoom(_ roomID: String, message: String?, via: [String]) async -> Result { do { - let _ = try await client.knock(roomIdOrAlias: roomID, reason: message, serverNames: via) + let _ = try await client.knock(roomIdOrAlias: roomID) await waitForRoomToSync(roomID: roomID, timeout: .seconds(30)) return .success(()) } catch { @@ -428,7 +428,7 @@ class ClientProxy: ClientProxyProtocol { func knockRoomAlias(_ roomAlias: String, message: String?) async -> Result { do { - let room = try await client.knock(roomIdOrAlias: roomAlias, reason: message, serverNames: []) + let room = try await client.knock(roomIdOrAlias: roomAlias) await waitForRoomToSync(roomID: room.id(), timeout: .seconds(30)) return .success(()) } catch { diff --git a/ElementX/Sources/Services/Room/RoomSummary/RoomSummary.swift b/ElementX/Sources/Services/Room/RoomSummary/RoomSummary.swift index 942a78704f..ff2045209b 100644 --- a/ElementX/Sources/Services/Room/RoomSummary/RoomSummary.swift +++ b/ElementX/Sources/Services/Room/RoomSummary/RoomSummary.swift @@ -9,11 +9,16 @@ import Foundation import MatrixRustSDK struct RoomSummary { + enum JoinRequestType { + case invite + case knocked + } + let roomListItem: RoomListItem let id: String - let isInvite: Bool + let joinRequestType: JoinRequestType? let inviter: RoomMemberProxyProtocol? let name: String @@ -70,7 +75,7 @@ extension RoomSummary { inviter = nil hasOngoingCall = false - isInvite = false + joinRequestType = nil isMarkedUnread = false isFavourite = false } diff --git a/ElementX/Sources/Services/Room/RoomSummary/RoomSummaryProvider.swift b/ElementX/Sources/Services/Room/RoomSummary/RoomSummaryProvider.swift index b1b4c37192..a40f17a53f 100644 --- a/ElementX/Sources/Services/Room/RoomSummary/RoomSummaryProvider.swift +++ b/ElementX/Sources/Services/Room/RoomSummary/RoomSummaryProvider.swift @@ -258,9 +258,15 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol { let notificationMode = roomInfo.cachedUserDefinedNotificationMode.flatMap { RoomNotificationModeProxy.from(roomNotificationMode: $0) } + let joinRequestType: RoomSummary.JoinRequestType? = switch roomInfo.membership { + case .invited: .invite + case .knocked: .knocked + default: nil + } + return RoomSummary(roomListItem: roomListItem, id: roomInfo.id, - isInvite: roomInfo.membership == .invited, + joinRequestType: joinRequestType, inviter: inviterProxy, name: roomInfo.displayName ?? roomInfo.id, isDirect: roomInfo.isDirect, diff --git a/PreviewTests/Sources/GeneratedPreviewTests.swift b/PreviewTests/Sources/GeneratedPreviewTests.swift index 615b072af3..c8396e7d45 100644 --- a/PreviewTests/Sources/GeneratedPreviewTests.swift +++ b/PreviewTests/Sources/GeneratedPreviewTests.swift @@ -245,6 +245,12 @@ extension PreviewTests { } } + func test_homeScreenKnockedCell() { + for preview in HomeScreenKnockedCell_Previews._allPreviews { + assertSnapshots(matching: preview) + } + } + func test_homeScreenRecoveryKeyConfirmationBanner() { for preview in HomeScreenRecoveryKeyConfirmationBanner_Previews._allPreviews { assertSnapshots(matching: preview) diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_homeScreenKnockedCell-iPad-en-GB.1.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_homeScreenKnockedCell-iPad-en-GB.1.png new file mode 100644 index 0000000000..874d536301 --- /dev/null +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_homeScreenKnockedCell-iPad-en-GB.1.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:37d4585f90bb64bf739101413ed1a7e24db10161670bd0ba38409e146b31645f +size 175190 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_homeScreenKnockedCell-iPad-pseudo.1.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_homeScreenKnockedCell-iPad-pseudo.1.png new file mode 100644 index 0000000000..750e5a441f --- /dev/null +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_homeScreenKnockedCell-iPad-pseudo.1.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:216f3373784519707d3659d6282a1c59202f189407c2f1226bdff510a5f9261c +size 188573 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_homeScreenKnockedCell-iPhone-16-en-GB.1.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_homeScreenKnockedCell-iPhone-16-en-GB.1.png new file mode 100644 index 0000000000..b819d05cd5 --- /dev/null +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_homeScreenKnockedCell-iPhone-16-en-GB.1.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c674069ca803e934769bb070a528e415ca12de00f722fbb67bf0624a1f24305f +size 120759 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_homeScreenKnockedCell-iPhone-16-pseudo.1.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_homeScreenKnockedCell-iPhone-16-pseudo.1.png new file mode 100644 index 0000000000..adc229bec1 --- /dev/null +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_homeScreenKnockedCell-iPhone-16-pseudo.1.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1d39cc8560c7f57e27764b782dd5ef07e31d883d265f675d8e4f394dccd82e69 +size 142235 diff --git a/UnitTests/Sources/HomeScreenRoomTests.swift b/UnitTests/Sources/HomeScreenRoomTests.swift index bb47ffc0ce..f0615ccf47 100644 --- a/UnitTests/Sources/HomeScreenRoomTests.swift +++ b/UnitTests/Sources/HomeScreenRoomTests.swift @@ -23,7 +23,7 @@ class HomeScreenRoomTests: XCTestCase { hasOngoingCall: Bool) { roomSummary = RoomSummary(roomListItem: .init(noPointer: .init()), id: "Test room", - isInvite: false, + joinRequestType: nil, inviter: nil, name: "Test room", isDirect: false, diff --git a/UnitTests/Sources/JoinRoomScreenViewModelTests.swift b/UnitTests/Sources/JoinRoomScreenViewModelTests.swift index 42b1b6a526..d9632db020 100644 --- a/UnitTests/Sources/JoinRoomScreenViewModelTests.swift +++ b/UnitTests/Sources/JoinRoomScreenViewModelTests.swift @@ -56,6 +56,17 @@ class JoinRoomScreenViewModelTests: XCTestCase { }.fulfill() } + func testCancelKnockAlert() async throws { + setupViewModel(knocked: true) + + try await deferFulfillment(viewModel.context.$viewState) { state in + state.mode == .knocked + }.fulfill() + + context.send(viewAction: .cancelKnock) + XCTAssertEqual(viewModel.context.alertInfo?.id, .cancelKnock) + } + private func setupViewModel(throwing: Bool = false, knocked: Bool = false) { let clientProxy = ClientProxyMock(.init()) @@ -75,7 +86,10 @@ class JoinRoomScreenViewModelTests: XCTestCase { if knocked { clientProxy.roomForIdentifierClosure = { _ in - .knocked(KnockedRoomProxyMock(.init())) + let roomProxy = KnockedRoomProxyMock(.init()) + // to test the cancel knock function + roomProxy.cancelKnockUnderlyingReturnValue = .success(()) + return .knocked(roomProxy) } } diff --git a/UnitTests/Sources/LoggingTests.swift b/UnitTests/Sources/LoggingTests.swift index 20205e5209..e5370a37a5 100644 --- a/UnitTests/Sources/LoggingTests.swift +++ b/UnitTests/Sources/LoggingTests.swift @@ -80,7 +80,7 @@ class LoggingTests: XCTestCase { let heroName = "Pseudonym" let roomSummary = RoomSummary(roomListItem: .init(noPointer: .init()), id: "myroomid", - isInvite: false, + joinRequestType: nil, inviter: nil, name: roomName, isDirect: true, diff --git a/UnitTests/Sources/RoomSummaryTests.swift b/UnitTests/Sources/RoomSummaryTests.swift index 55cb93948d..84e8820e0f 100644 --- a/UnitTests/Sources/RoomSummaryTests.swift +++ b/UnitTests/Sources/RoomSummaryTests.swift @@ -56,7 +56,7 @@ class RoomSummaryTests: XCTestCase { func makeSummary(isDirect: Bool, hasRoomAvatar: Bool) -> RoomSummary { RoomSummary(roomListItem: .init(noPointer: .init()), id: roomDetails.id, - isInvite: false, + joinRequestType: nil, inviter: nil, name: roomDetails.name, isDirect: isDirect, From fb9f07db39617beb7457d91b8dc5530e6c6b576e Mon Sep 17 00:00:00 2001 From: Mauro Romito Date: Tue, 22 Oct 2024 17:41:48 +0200 Subject: [PATCH 13/20] design update --- .../Sources/Mocks/InvitedRoomProxyMock.swift | 31 +++++++++++++++++++ .../JoinRoomScreenCoordinator.swift | 2 +- .../JoinRoomScreen/JoinRoomScreenModels.swift | 2 +- .../JoinRoomScreenViewModel.swift | 4 +-- .../JoinRoomScreen/View/JoinRoomScreen.swift | 29 ++++++++++++++--- .../test_joinRoomScreen-iPad-en-GB.Invite.png | 4 +-- .../test_joinRoomScreen-iPad-en-GB.Join.png | 4 +-- .../test_joinRoomScreen-iPad-en-GB.Knock.png | 4 +-- ...test_joinRoomScreen-iPad-en-GB.Knocked.png | 4 +-- ...test_joinRoomScreen-iPad-en-GB.Unknown.png | 4 +-- ...test_joinRoomScreen-iPad-pseudo.Invite.png | 4 +-- .../test_joinRoomScreen-iPad-pseudo.Join.png | 4 +-- .../test_joinRoomScreen-iPad-pseudo.Knock.png | 4 +-- ...est_joinRoomScreen-iPad-pseudo.Knocked.png | 4 +-- ...est_joinRoomScreen-iPad-pseudo.Unknown.png | 4 +-- ..._joinRoomScreen-iPhone-16-en-GB.Invite.png | 4 +-- ...st_joinRoomScreen-iPhone-16-en-GB.Join.png | 4 +-- ...t_joinRoomScreen-iPhone-16-en-GB.Knock.png | 4 +-- ...joinRoomScreen-iPhone-16-en-GB.Knocked.png | 4 +-- ...joinRoomScreen-iPhone-16-en-GB.Unknown.png | 4 +-- ...joinRoomScreen-iPhone-16-pseudo.Invite.png | 4 +-- ...t_joinRoomScreen-iPhone-16-pseudo.Join.png | 4 +-- ..._joinRoomScreen-iPhone-16-pseudo.Knock.png | 4 +-- ...oinRoomScreen-iPhone-16-pseudo.Knocked.png | 4 +-- ...oinRoomScreen-iPhone-16-pseudo.Unknown.png | 4 +-- .../JoinRoomScreenViewModelTests.swift | 8 ++++- 26 files changed, 106 insertions(+), 50 deletions(-) create mode 100644 ElementX/Sources/Mocks/InvitedRoomProxyMock.swift diff --git a/ElementX/Sources/Mocks/InvitedRoomProxyMock.swift b/ElementX/Sources/Mocks/InvitedRoomProxyMock.swift new file mode 100644 index 0000000000..5155a6febd --- /dev/null +++ b/ElementX/Sources/Mocks/InvitedRoomProxyMock.swift @@ -0,0 +1,31 @@ +// +// Copyright 2024 New Vector Ltd. +// +// SPDX-License-Identifier: AGPL-3.0-only +// Please see LICENSE in the repository root for full details. +// + +import Combine +import Foundation + +@MainActor +struct InvitedRoomProxyMockConfiguration { + var id = UUID().uuidString + var name: String? + var avatarURL: URL? + var members: [RoomMemberProxyMock] = .allMembers + var inviter: RoomMemberProxyMock = .mockAlice +} + +extension InvitedRoomProxyMock { + @MainActor + convenience init(_ configuration: InvitedRoomProxyMockConfiguration) { + self.init() + id = configuration.id + name = configuration.name + avatarURL = configuration.avatarURL + avatar = .room(id: configuration.id, name: configuration.name, avatarURL: configuration.avatarURL) // Note: This doesn't replicate the real proxy logic. + underlyingInviter = configuration.inviter + activeMembersCount = configuration.members.filter { $0.membership == .join || $0.membership == .invite }.count + } +} diff --git a/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenCoordinator.swift b/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenCoordinator.swift index fbe2e23c0d..d259e53e1b 100644 --- a/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenCoordinator.swift +++ b/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenCoordinator.swift @@ -49,7 +49,7 @@ final class JoinRoomScreenCoordinator: CoordinatorProtocol { switch action { case .joined: actionsSubject.send(.joined) - case .cancelled: + case .dismiss: actionsSubject.send(.cancelled) } } diff --git a/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenModels.swift b/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenModels.swift index cad0b049f2..5def712723 100644 --- a/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenModels.swift +++ b/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenModels.swift @@ -9,7 +9,7 @@ import Foundation enum JoinRoomScreenViewModelAction { case joined - case cancelled + case dismiss } enum JoinRoomScreenInteractionMode { diff --git a/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenViewModel.swift b/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenViewModel.swift index 289459a290..dc13cf9707 100644 --- a/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenViewModel.swift +++ b/ElementX/Sources/Screens/JoinRoomScreen/JoinRoomScreenViewModel.swift @@ -249,7 +249,7 @@ class JoinRoomScreenViewModel: JoinRoomScreenViewModelType, JoinRoomScreenViewMo if case .failure = result { userIndicatorController.submitIndicator(.init(title: L10n.errorUnknown)) } else { - await updateRoom() + actionsSubject.send(.dismiss) } } @@ -270,7 +270,7 @@ class JoinRoomScreenViewModel: JoinRoomScreenViewModelType, JoinRoomScreenViewMo if case .failure = result { userIndicatorController.submitIndicator(.init(title: L10n.errorUnknown)) } else { - await updateRoom() + actionsSubject.send(.dismiss) } } diff --git a/ElementX/Sources/Screens/JoinRoomScreen/View/JoinRoomScreen.swift b/ElementX/Sources/Screens/JoinRoomScreen/View/JoinRoomScreen.swift index c373c22312..545bc4017b 100644 --- a/ElementX/Sources/Screens/JoinRoomScreen/View/JoinRoomScreen.swift +++ b/ElementX/Sources/Screens/JoinRoomScreen/View/JoinRoomScreen.swift @@ -14,7 +14,7 @@ struct JoinRoomScreen: View { @ObservedObject var context: JoinRoomScreenViewModel.Context var body: some View { - FullscreenDialog(topPadding: 80, background: .bloom) { + FullscreenDialog(topPadding: context.viewState.mode == .knocked ? 151 : 35, background: .bloom) { if context.viewState.mode == .loading { EmptyView() } else { @@ -27,6 +27,7 @@ struct JoinRoomScreen: View { .background() .backgroundStyle(.compound.bgCanvasDefault) .navigationBarTitleDisplayMode(.inline) + .toolbar { toolbar } } @ViewBuilder @@ -55,7 +56,7 @@ struct JoinRoomScreen: View { if let subtitle = context.viewState.subtitle { Text(subtitle) - .font(.compound.bodyMD) + .font(.compound.bodyLG) .foregroundStyle(.compound.textSecondary) .multilineTextAlignment(.center) } @@ -109,7 +110,7 @@ struct JoinRoomScreen: View { HStack(spacing: 0) { TextField("", text: $context.knockMessage, axis: .vertical) .onChange(of: context.knockMessage) { newValue in - context.knockMessage = String(newValue.prefix(1000)) + context.knockMessage = String(newValue.prefix(500)) } .lineLimit(4, reservesSpace: true) .font(.compound.bodyMD) @@ -159,6 +160,17 @@ struct JoinRoomScreen: View { Button(L10n.actionAccept) { context.send(viewAction: .acceptInvite) } .buttonStyle(.compound(.primary)) } + + @ToolbarContentBuilder + private var toolbar: some ToolbarContent { + if context.viewState.mode == .knocked { + ToolbarItem(placement: .principal) { + RoomHeaderView(roomName: context.viewState.title, + roomAvatar: context.viewState.avatar, + mediaProvider: context.mediaProvider) + } + } + } } // MARK: - Previews @@ -222,10 +234,17 @@ struct JoinRoomScreen_Previews: PreviewProvider, TestablePreview { if mode == .unknown { clientProxy.roomPreviewForIdentifierViaReturnValue = .failure(.sdkError(ClientProxyMockError.generic)) } else { - if mode == .knocked { + switch mode { + case .knocked: + clientProxy.roomForIdentifierClosure = { _ in + .knocked(KnockedRoomProxyMock(.init(avatarURL: URL.homeDirectory))) + } + case .invited: clientProxy.roomForIdentifierClosure = { _ in - .knocked(KnockedRoomProxyMock(.init())) + .invited(InvitedRoomProxyMock(.init(avatarURL: URL.homeDirectory))) } + default: + break } clientProxy.roomPreviewForIdentifierViaReturnValue = .success(.init(roomID: "1", name: "The Three-Body Problem - 三体", diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-en-GB.Invite.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-en-GB.Invite.png index c20572b221..f190faed8f 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-en-GB.Invite.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-en-GB.Invite.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:227bd893c17ef8a6042e6eab9372eb78c3cbb631c4b232f13d6e6f0179ce02c7 -size 1982377 +oid sha256:d5b3a8bd64746aad774b15fc3e3500bbab4144d64ed4f8714f9b2527c70a494c +size 1990774 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-en-GB.Join.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-en-GB.Join.png index 7fc18921f5..a140b1c4b7 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-en-GB.Join.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-en-GB.Join.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:146c20f80acac9bf9497aa93562cb930bea02e6fb82507d971a22c26bf3e28a6 -size 1946311 +oid sha256:b6be25a2a046c3d1088ae6f87e4e1e0033062225c624095d679f1083ffe538b6 +size 1945746 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-en-GB.Knock.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-en-GB.Knock.png index 3b61214cdc..80328b815e 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-en-GB.Knock.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-en-GB.Knock.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:adb3e3a08681e2febea9cd377862eededc6b576bfe06c753bf075eb886f55f9f -size 1788568 +oid sha256:46447c25230d95f04d122924d938f6f4b5eacd633140e586c3c276322f8e8b75 +size 1791354 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-en-GB.Knocked.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-en-GB.Knocked.png index 16efb5ef59..0c7b3c0a4f 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-en-GB.Knocked.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-en-GB.Knocked.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:79f1c8ea20c6791a7d25d8fc18f45d1d0fef989b8fa0316c5b312bfc9dd4c271 -size 1972382 +oid sha256:3de2000689563a5a4fa149245c305236ec0f42516c98c5112006f339537ffd60 +size 1981547 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-en-GB.Unknown.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-en-GB.Unknown.png index f57487803d..0b5feb40a9 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-en-GB.Unknown.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-en-GB.Unknown.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:efda9145642c0bef47507f9de249565cb09897bfed8f4fa6ae79ec792c067fb5 -size 1890674 +oid sha256:c85ef3dcec00111c6c6bb9fe6cfbb1f2bbf332631cc681ea41642f411a4c761e +size 1890475 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-pseudo.Invite.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-pseudo.Invite.png index 5bc940cd75..3691161625 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-pseudo.Invite.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-pseudo.Invite.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:91e9b65c2ad0972f12351bad8d93c627a9d73a87cb22356cd9fc53c81625ed7d -size 1983445 +oid sha256:41f91af2b20ff571cdf281d4dedaf1f6749a8fdaf33508a1b70511ef6e477af4 +size 1995837 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-pseudo.Join.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-pseudo.Join.png index d9ded5d4e5..daf9980781 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-pseudo.Join.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-pseudo.Join.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:48852e2e65d9c3000b2069521628f577426801ab4a804a1f30100540a573bc66 -size 1947292 +oid sha256:daf1b08dbe20c63aa66d1c16e3bc41fdc92a54ad4f143ccfcd9ca8382964a0fe +size 1946727 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-pseudo.Knock.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-pseudo.Knock.png index d34ffa65c4..e0acdc11eb 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-pseudo.Knock.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-pseudo.Knock.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:338b8be69ace718a2796101e2ccfbe93dca412e299279a6078b785fec10e7e4b -size 1797161 +oid sha256:08e0296e33a657e0c42f95cb2e4963cb8f32c3a37979262cd76bc4c3ac3a7132 +size 1799819 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-pseudo.Knocked.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-pseudo.Knocked.png index 65181a2704..7a54965071 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-pseudo.Knocked.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-pseudo.Knocked.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d159ef72270668acb4ffe1443954086a895e630d5809ff51a65b9302ada8ca89 -size 1988527 +oid sha256:879b20b02098aacfd712cafc012629cd2d20a128474962da18a675cb78fa3e24 +size 1998640 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-pseudo.Unknown.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-pseudo.Unknown.png index 9b611d6ef7..e3b1a370d0 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-pseudo.Unknown.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-pseudo.Unknown.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b1e33030ab7373ae71f3ac6b2580a1187f8ec21d81da94831a3f8ea6fdbcfc0a -size 1895360 +oid sha256:0fde3ae365ead45c6789493ec6dcd5569f420d823d778ebe2549b36e1076052a +size 1895270 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-en-GB.Invite.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-en-GB.Invite.png index c971358184..30981c1a0a 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-en-GB.Invite.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-en-GB.Invite.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b5bb2adb3c27c6adad8d72174d662688ce1b40a90d748b00354717abf5d37f56 -size 817765 +oid sha256:616a8a5fe92ef87797d9a69bd5d7581e685edad21b002bf079d1a02fdb782987 +size 827638 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-en-GB.Join.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-en-GB.Join.png index c1384ca8df..4e9483a8df 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-en-GB.Join.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-en-GB.Join.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:eca394ab7064165321d8eba0c1110b56c5e815260cef52f69cc61ec7c4bc7d3b -size 796819 +oid sha256:6d7390ef83a9fb7e8887aff95c03282d4fbcf3826cf3e254d523373a2c434df0 +size 798961 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-en-GB.Knock.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-en-GB.Knock.png index f0f6bd47a8..ce2bdf2f6b 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-en-GB.Knock.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-en-GB.Knock.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0be47f8b5c89c0d03e4713e32686c457452851ccc246bf4588f5cb5f82fdbabc -size 701611 +oid sha256:3f9518a386e4c12c9e1527eb5f841fb0ca56fc8658529b58d6d459376caca39b +size 705027 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-en-GB.Knocked.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-en-GB.Knocked.png index 4e8d7e6c1c..cd87d24b44 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-en-GB.Knocked.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-en-GB.Knocked.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4e0a6de1d32f7d2845bf66ae655ac2b7404083a6d3478f96e1eea29f0b102e51 -size 811030 +oid sha256:e405d83b38b72125a22af8f32e5dfa3c7a9bba65ae7f7acbeddc9d27d87d80be +size 817932 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-en-GB.Unknown.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-en-GB.Unknown.png index 90e6e10896..c9a6df3a90 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-en-GB.Unknown.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-en-GB.Unknown.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c001018d811bda7d9db87503f38d94dc23a2102bc134d08b69e3af171ecbf350 -size 755374 +oid sha256:068da1ad317aefc4ebed25f4ac259cd5fe46a5ce444b6e22051455d69bfea78e +size 756893 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-pseudo.Invite.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-pseudo.Invite.png index c70e647ccd..1de1b350e5 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-pseudo.Invite.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-pseudo.Invite.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9a922e59c0fec9924f16c3e224af836de79d818fab3e686c1fb34c707be1fc23 -size 820225 +oid sha256:6ecca9bbfa7a1d245a96fc27aacfb5d60931ba1437639ebd8e9ff1756bd705c6 +size 835366 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-pseudo.Join.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-pseudo.Join.png index 0acd1dcc66..42fb8407bb 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-pseudo.Join.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-pseudo.Join.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7fb7955f605d2ad9e5678438af15a1a354baab5f00e59ca0ff458759e93d76b1 -size 798533 +oid sha256:450d28a2af4b81f2db2e8a1fb28405d029439cabf5f48688b448391dd7e43b05 +size 800675 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-pseudo.Knock.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-pseudo.Knock.png index 999c04fe9b..dfd17d6251 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-pseudo.Knock.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-pseudo.Knock.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:471ae5bf707a3f9e91b7f8cea098287bb21d618297d027a72c105575b5049ff8 -size 709284 +oid sha256:858759589a323ce04e894f398c230c0454f64a3c3148b183f9ecdbeb29955b89 +size 714177 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-pseudo.Knocked.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-pseudo.Knocked.png index daca3b20bf..0612a40add 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-pseudo.Knocked.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-pseudo.Knocked.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3e8581d10df35158cd98cc36e23f1ca1ad38659732699bd7073f92aa4331e847 -size 828204 +oid sha256:d3e473eba8ecd60d96375d75816b626fc4c42abfa62fc30e6a42b060aa005d26 +size 834574 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-pseudo.Unknown.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-pseudo.Unknown.png index e943319e83..31f5cf6ebb 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-pseudo.Unknown.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-pseudo.Unknown.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:93d65076d29abb7a6476b649fae781a8be6bad9d4b905c8251b7253498af3d3e -size 761944 +oid sha256:eaa7027ce0d6ba02e75bc6b35cd7080a4cf217e6d36b3aa2bcebfce6355ad117 +size 763528 diff --git a/UnitTests/Sources/JoinRoomScreenViewModelTests.swift b/UnitTests/Sources/JoinRoomScreenViewModelTests.swift index d9632db020..2f8b6e0521 100644 --- a/UnitTests/Sources/JoinRoomScreenViewModelTests.swift +++ b/UnitTests/Sources/JoinRoomScreenViewModelTests.swift @@ -56,7 +56,7 @@ class JoinRoomScreenViewModelTests: XCTestCase { }.fulfill() } - func testCancelKnockAlert() async throws { + func testCancelKnock() async throws { setupViewModel(knocked: true) try await deferFulfillment(viewModel.context.$viewState) { state in @@ -65,6 +65,12 @@ class JoinRoomScreenViewModelTests: XCTestCase { context.send(viewAction: .cancelKnock) XCTAssertEqual(viewModel.context.alertInfo?.id, .cancelKnock) + + let deferred = deferFulfillment(viewModel.actionsPublisher) { action in + action == .dismiss + } + context.alertInfo?.secondaryButton?.action?() + try await deferred.fulfill() } private func setupViewModel(throwing: Bool = false, knocked: Bool = false) { From 008b7b6b763461142c6cdfb8c2eea287455daa70 Mon Sep 17 00:00:00 2001 From: Mauro Romito Date: Tue, 22 Oct 2024 18:45:26 +0200 Subject: [PATCH 14/20] updated SDK --- ElementX.xcodeproj/project.pbxproj | 66 +- .../xcshareddata/swiftpm/Package.resolved | 4 +- .../Mocks/Generated/GeneratedMocks.swift | 48 +- .../Mocks/Generated/SDKGeneratedMocks.swift | 618 +++++++++--------- .../Sources/Services/Client/ClientProxy.swift | 2 +- .../Services/Client/ClientProxyProtocol.swift | 8 - .../Services/Room/JoinedRoomProxy.swift | 5 +- .../RoomSummary/RoomSummaryProvider.swift | 5 +- .../Services/Timeline/TimelineProxy.swift | 10 +- project.yml | 2 +- 10 files changed, 380 insertions(+), 388 deletions(-) diff --git a/ElementX.xcodeproj/project.pbxproj b/ElementX.xcodeproj/project.pbxproj index dfda797d7f..3906f6ea30 100644 --- a/ElementX.xcodeproj/project.pbxproj +++ b/ElementX.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 56; + objectVersion = 54; objects = { /* Begin PBXAggregateTarget section */ @@ -46,6 +46,7 @@ 06D3942496E9E0E655F14D21 /* NotificationManagerProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = A057F2FDC14866C3026A89A4 /* NotificationManagerProtocol.swift */; }; 06F8EDF52E33A2D36BCC1161 /* AppLockScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 56D6F88FE35A0979D2821E06 /* AppLockScreen.swift */; }; 071A017E415AD378F2961B11 /* URL.swift in Sources */ = {isa = PBXBuildFile; fileRef = 227AC5D71A4CE43512062243 /* URL.swift */; }; + 07376A5274822EB45CC320C7 /* InvitedRoomProxyMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A21027F05874B1BCC3E452B /* InvitedRoomProxyMock.swift */; }; 07756D532EFE33DD1FA258E5 /* GeoURITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1A7ED2EF5BDBAD2A7DBC4636 /* GeoURITests.swift */; }; 077CB230153E072C94B1E6C3 /* AppAppearance.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D65BCC659FD9087E49B3C25 /* AppAppearance.swift */; }; 07CC13C5729C24255348CBBD /* ElementCallWidgetDriver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 309AD8BAE6437C31BA7157BF /* ElementCallWidgetDriver.swift */; }; @@ -456,6 +457,7 @@ 661EF50C1F7D4B0BC8A7AAE3 /* EmoteRoomTimelineView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 44ABA63DBE7F76C58260B43B /* EmoteRoomTimelineView.swift */; }; 66357ECB73B1290E5490A012 /* WebRegistrationScreenViewModelProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F418426410F3823F3EB0828 /* WebRegistrationScreenViewModelProtocol.swift */; }; 663E198678778F7426A9B27D /* Collection.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9FAFE1C2149E6AC8156ED2B /* Collection.swift */; }; + 6681D6D3ADF69EBD2625F29A /* KnockedRoomProxyMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9E8F4D7D61B80EBD5CB92F8A /* KnockedRoomProxyMock.swift */; }; 67160204A8D362BB7D4AD259 /* Search.swift in Sources */ = {isa = PBXBuildFile; fileRef = 693E16574C6F7F9FA1015A8C /* Search.swift */; }; 6786C4B0936AC84D993B20BF /* NotificationSettingsScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5F06F2F09B2EDD067DC2174 /* NotificationSettingsScreen.swift */; }; 6793E75E3EBE48EBB8F857AF /* ProcessInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 077B01C13BBA2996272C5FB5 /* ProcessInfo.swift */; }; @@ -609,6 +611,7 @@ 865DD5CA474C6AE6C2BC008E /* NetworkMonitorProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1575947B7A6FE08C57FE5EE4 /* NetworkMonitorProtocol.swift */; }; 86675910612A12409262DFBD /* SessionVerificationStateMachineTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A1C22B1B5FA3A765EADB2CC9 /* SessionVerificationStateMachineTests.swift */; }; 8691186F9B99BCDDB7CACDD8 /* KeychainController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E36CB905A2B9EC2C92A2DA7C /* KeychainController.swift */; }; + 86DFA58FBBEB0AF671D2A1E1 /* HomeScreenKnockedCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A103580EBA06155B1343EF16 /* HomeScreenKnockedCell.swift */; }; 86F9D3028A1F4AE819D75560 /* RoomChangePermissionsScreenCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D879FC4E881E748BB9B34DC /* RoomChangePermissionsScreenCoordinator.swift */; }; 872A6457DF573AF8CEAE927A /* LoginHomeserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9349F590E35CE514A71E6764 /* LoginHomeserver.swift */; }; 874FEFB9D4A4AF447E0E086E /* AuthenticationStartScreenViewModelProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0F7CCC4A9D1927223F559D5 /* AuthenticationStartScreenViewModelProtocol.swift */; }; @@ -767,8 +770,6 @@ A6D4C5EEA85A6A0ABA1559D6 /* RoomDetailsEditScreenModels.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16D09C79746BDCD9173EB3A7 /* RoomDetailsEditScreenModels.swift */; }; A6DEC1ADEC8FEEC206A0FA37 /* AttributedStringBuilderProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 72F37B5DA798C9AE436F2C2C /* AttributedStringBuilderProtocol.swift */; }; A6F345328CCC5C9B0DAE2257 /* LogViewerScreenViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0BB05221D7D941CC82DC8480 /* LogViewerScreenViewModel.swift */; }; - A71F957D2CBFF33100FDBDF2 /* KnockedRoomProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = A71F957C2CBFF32A00FDBDF2 /* KnockedRoomProxy.swift */; }; - A71F957F2CBFFD2500FDBDF2 /* KnockedRoomProxyMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = A71F957E2CBFFD1F00FDBDF2 /* KnockedRoomProxyMock.swift */; }; A722F426FD81FC67706BB1E0 /* CustomLayoutLabelStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 42236480CF0431535EBE8387 /* CustomLayoutLabelStyle.swift */; }; A74438ED16F8683A4B793E6A /* AnalyticsSettingsScreenViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0BCE3FAF40932AC7C7639AC4 /* AnalyticsSettingsScreenViewModel.swift */; }; A7D48E44D485B143AADDB77D /* Strings+Untranslated.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1A18F6CE4D694D21E4EA9B25 /* Strings+Untranslated.swift */; }; @@ -906,6 +907,7 @@ C8C7AF33AADF88B306CD2695 /* QRCodeLoginService.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4427AF4B7FB7EF3E3D424C7 /* QRCodeLoginService.swift */; }; C8E0FA0FF2CD6613264FA6B9 /* MessageForwardingScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFEA446F8618DBA79A9239CC /* MessageForwardingScreen.swift */; }; C915347779B3C7FDD073A87A /* AVMetadataMachineReadableCodeObjectExtensionsTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93E1FF0DFBB3768F79FDBF6D /* AVMetadataMachineReadableCodeObjectExtensionsTest.swift */; }; + C969A62F3D9F14318481A33B /* KnockedRoomProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 858DA81F2ACF484B7CAD6AE4 /* KnockedRoomProxy.swift */; }; C97325EFDCCEE457432A9E82 /* MessageText.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1E0B4A34E69BD2132BEC521 /* MessageText.swift */; }; C9A631FD968249B4BA0B7B3C /* ReactionsSummaryView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02EE0FABA8ED6D6C1D6CE71D /* ReactionsSummaryView.swift */; }; C9ABF75A43F2D26F1D9A1F27 /* DeactivateAccountScreenViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2AC3FDB58F57386741A4FC7F /* DeactivateAccountScreenViewModel.swift */; }; @@ -1215,13 +1217,13 @@ 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; lastKnownFileType = file; path = test_voice_message.m4a; sourceTree = ""; }; + 0392E3FDE372C9B56FEEED8B /* test_voice_message.m4a */ = {isa = PBXFileReference; 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 = ""; }; 045253F9967A535EE5B16691 /* Label.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Label.swift; sourceTree = ""; }; 046C0D3F53B0B5EF0A1F5BEA /* RoomSummaryTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomSummaryTests.swift; sourceTree = ""; }; - 048A21188AB19349D026BECD /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = ""; }; + 048A21188AB19349D026BECD /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; path = PrivacyInfo.xcprivacy; sourceTree = ""; }; 04BB8DDE245ED86C489BA983 /* AccessibilityIdentifiers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccessibilityIdentifiers.swift; sourceTree = ""; }; 04DF593C3F7AF4B2FBAEB05D /* FileManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileManager.swift; sourceTree = ""; }; 0516C69708D5CBDE1A8E77EC /* RoomDirectorySearchProxyProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomDirectorySearchProxyProtocol.swift; sourceTree = ""; }; @@ -1287,7 +1289,7 @@ 127A57D053CE8C87B5EFB089 /* Consumable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Consumable.swift; sourceTree = ""; }; 127C8472672A5BA09EF1ACF8 /* CurrentValuePublisher.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CurrentValuePublisher.swift; sourceTree = ""; }; 128501375217576AF0FE3E92 /* RoomAttachmentPicker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomAttachmentPicker.swift; sourceTree = ""; }; - 1304D9191300873EADA52D6E /* IntegrationTests.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = IntegrationTests.xctestplan; sourceTree = ""; }; + 1304D9191300873EADA52D6E /* IntegrationTests.xctestplan */ = {isa = PBXFileReference; path = IntegrationTests.xctestplan; sourceTree = ""; }; 130ED565A078F7E0B59D9D25 /* UNTextInputNotificationResponse+Creator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UNTextInputNotificationResponse+Creator.swift"; sourceTree = ""; }; 136F80A613B55BDD071DCEA5 /* JoinRoomScreenModels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JoinRoomScreenModels.swift; sourceTree = ""; }; 13802897C7AFA360EA74C0B0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = en; path = en.lproj/Localizable.stringsdict; sourceTree = ""; }; @@ -1376,7 +1378,7 @@ 25F7FE40EF7490A7E09D7BE6 /* NotificationItemProxy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationItemProxy.swift; sourceTree = ""; }; 25F8664F1FB95AF3C4202478 /* PollFormScreenCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PollFormScreenCoordinator.swift; sourceTree = ""; }; 260004737C573A56FA01E86E /* Encodable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Encodable.swift; sourceTree = ""; }; - 267BB1D5B08A9511F894CB57 /* PreviewTests.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = PreviewTests.xctestplan; sourceTree = ""; }; + 267BB1D5B08A9511F894CB57 /* PreviewTests.xctestplan */ = {isa = PBXFileReference; path = PreviewTests.xctestplan; sourceTree = ""; }; 26B0A96B8FE4849227945067 /* VoiceMessageRecorder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VoiceMessageRecorder.swift; sourceTree = ""; }; 26EAAB54C6CE91D64B69A9F8 /* AppLockServiceProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppLockServiceProtocol.swift; sourceTree = ""; }; 2721D7B051F0159AA919DA05 /* RoomChangePermissionsScreenViewModelProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomChangePermissionsScreenViewModelProtocol.swift; sourceTree = ""; }; @@ -1447,7 +1449,7 @@ 3558A15CFB934F9229301527 /* RestorationToken.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RestorationToken.swift; sourceTree = ""; }; 35AFCF4C05DEED04E3DB1A16 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/Localizable.strings; sourceTree = ""; }; 35FA991289149D31F4286747 /* UserPreference.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserPreference.swift; sourceTree = ""; }; - 36DA824791172B9821EACBED /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = ""; }; + 36DA824791172B9821EACBED /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; path = PrivacyInfo.xcprivacy; sourceTree = ""; }; 36FD673E24FBFCFDF398716A /* RoomMemberProxyMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomMemberProxyMock.swift; sourceTree = ""; }; 376D941BF8BB294389C0DE24 /* MapTilerURLBuildersTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapTilerURLBuildersTests.swift; sourceTree = ""; }; 37A243E04B58DC6E41FDCD82 /* EmojiItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmojiItem.swift; sourceTree = ""; }; @@ -1463,6 +1465,7 @@ 398817652FA8ABAE0A31AC6D /* ReadableFrameModifier.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReadableFrameModifier.swift; sourceTree = ""; }; 39C0D861FC397AC34BCF089E /* KeychainControllerMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeychainControllerMock.swift; sourceTree = ""; }; 3A12D3D8138F1B71AFA7C858 /* CompletionSuggestionService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CompletionSuggestionService.swift; sourceTree = ""; }; + 3A21027F05874B1BCC3E452B /* InvitedRoomProxyMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InvitedRoomProxyMock.swift; sourceTree = ""; }; 3AD253E7EFF88F308D644272 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/SAS.strings"; sourceTree = ""; }; 3B5E97E9615A158C76B2AB77 /* DateTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DateTests.swift; sourceTree = ""; }; 3BAC027034248429A438886B /* AppMediatorMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppMediatorMock.swift; sourceTree = ""; }; @@ -1551,7 +1554,7 @@ 4B41FABA2B0AEF4389986495 /* LoginMode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginMode.swift; sourceTree = ""; }; 4BD371B60E07A5324B9507EF /* AnalyticsSettingsScreenCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnalyticsSettingsScreenCoordinator.swift; sourceTree = ""; }; 4C8D988E82A8DFA13BE46F7C /* pl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = pl; path = pl.lproj/Localizable.stringsdict; sourceTree = ""; }; - 4CD6AC7546E8D7E5C73CEA48 /* ElementX.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ElementX.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 4CD6AC7546E8D7E5C73CEA48 /* ElementX.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = ElementX.app; sourceTree = BUILT_PRODUCTS_DIR; }; 4CDDDDD9FE1A699D23A5E096 /* LoginScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginScreen.swift; sourceTree = ""; }; 4D3A7375AB22721C436EB056 /* ComposerToolbarModels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ComposerToolbarModels.swift; sourceTree = ""; }; 4E2245243369B99216C7D84E /* ImageCache.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageCache.swift; sourceTree = ""; }; @@ -1784,6 +1787,7 @@ 854BCEAF2A832176FAACD2CB /* SplashScreenCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SplashScreenCoordinator.swift; sourceTree = ""; }; 85666E40F7E817809B4FD787 /* ComposerToolbar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ComposerToolbar.swift; sourceTree = ""; }; 8585C636A10B8141A7AE909F /* el */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = el; path = el.lproj/InfoPlist.strings; sourceTree = ""; }; + 858DA81F2ACF484B7CAD6AE4 /* KnockedRoomProxy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KnockedRoomProxy.swift; sourceTree = ""; }; 85EB16E7FE59A947CA441531 /* MediaProviderProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MediaProviderProtocol.swift; sourceTree = ""; }; 8609BE4CA71C30D1FCE3AF9B /* AuthenticationStartScreenModels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthenticationStartScreenModels.swift; sourceTree = ""; }; 8610C1D21565C950BCA6A454 /* AppLockSetupSettingsScreenViewModelProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppLockSetupSettingsScreenViewModelProtocol.swift; sourceTree = ""; }; @@ -1817,7 +1821,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 = ""; }; 8DA1E8F287680C8ED25EDBAC /* NetworkMonitorMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkMonitorMock.swift; sourceTree = ""; }; - 8E088F2A1B9EC529D3221931 /* UITests.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = UITests.xctestplan; sourceTree = ""; }; + 8E088F2A1B9EC529D3221931 /* UITests.xctestplan */ = {isa = PBXFileReference; path = UITests.xctestplan; sourceTree = ""; }; 8E1584F8BCF407BB94F48F04 /* EncryptionResetPasswordScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EncryptionResetPasswordScreen.swift; sourceTree = ""; }; 8EAF4A49F3ACD8BB8B0D2371 /* ClientSDKMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClientSDKMock.swift; sourceTree = ""; }; 8F21ED7205048668BEB44A38 /* AppActivityView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppActivityView.swift; sourceTree = ""; }; @@ -1887,6 +1891,7 @@ 9CE3C90E487B255B735D73C8 /* RoomScreenViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomScreenViewModel.swift; sourceTree = ""; }; 9CF1EE0AA78470C674554262 /* PillTextAttachment.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PillTextAttachment.swift; sourceTree = ""; }; 9E6D88E8AFFBF2C1D589C0FA /* UIConstants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIConstants.swift; sourceTree = ""; }; + 9E8F4D7D61B80EBD5CB92F8A /* KnockedRoomProxyMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KnockedRoomProxyMock.swift; sourceTree = ""; }; 9EB9BA2F30EB8C33226D8FF1 /* UserSessionStoreMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserSessionStoreMock.swift; sourceTree = ""; }; 9ECF11669EF253E98AA2977A /* CompletionSuggestionServiceProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CompletionSuggestionServiceProtocol.swift; sourceTree = ""; }; 9F1DF3FFFE5ED2B8133F43A7 /* MessageComposer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessageComposer.swift; sourceTree = ""; }; @@ -1897,6 +1902,7 @@ A019A12C866D64CF072024B9 /* AppLockSetupPINScreenViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppLockSetupPINScreenViewModel.swift; sourceTree = ""; }; A02D1A490944BF01A37586E1 /* sk */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sk; path = sk.lproj/SAS.strings; sourceTree = ""; }; A057F2FDC14866C3026A89A4 /* NotificationManagerProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationManagerProtocol.swift; sourceTree = ""; }; + A103580EBA06155B1343EF16 /* HomeScreenKnockedCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeScreenKnockedCell.swift; sourceTree = ""; }; A12D3B1BCF920880CA8BBB6B /* UserIndicatorControllerProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserIndicatorControllerProtocol.swift; sourceTree = ""; }; A130A2251A15A7AACC84FD37 /* RoomPollsHistoryScreenViewModelProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomPollsHistoryScreenViewModelProtocol.swift; sourceTree = ""; }; A16CD2C62CB7DB78A4238485 /* ReportContentScreenCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReportContentScreenCoordinator.swift; sourceTree = ""; }; @@ -1919,8 +1925,6 @@ A6B891A6DA826E2461DBB40F /* PHGPostHogConfiguration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PHGPostHogConfiguration.swift; sourceTree = ""; }; A6C11AD9813045E44F950410 /* ElementCallWidgetDriverProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ElementCallWidgetDriverProtocol.swift; sourceTree = ""; }; A6EA0D8B0BBD8805F7D5A133 /* TextBasedRoomTimelineViewProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextBasedRoomTimelineViewProtocol.swift; sourceTree = ""; }; - A71F957C2CBFF32A00FDBDF2 /* KnockedRoomProxy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KnockedRoomProxy.swift; sourceTree = ""; }; - A71F957E2CBFFD1F00FDBDF2 /* KnockedRoomProxyMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KnockedRoomProxyMock.swift; sourceTree = ""; }; A73A07BAEDD74C48795A996A /* AsyncSequence.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AsyncSequence.swift; sourceTree = ""; }; A7978C9EFBDD7DE39BD86726 /* RestorationTokenTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RestorationTokenTests.swift; sourceTree = ""; }; A7C4EA55DA62F9D0F984A2AE /* CollapsibleTimelineItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CollapsibleTimelineItem.swift; sourceTree = ""; }; @@ -1995,7 +1999,7 @@ B50F03079F6B5EF9CA005F14 /* TimelineProxyProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimelineProxyProtocol.swift; sourceTree = ""; }; B53AC78E49A297AC1D72A7CF /* AppMediator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppMediator.swift; sourceTree = ""; }; B590BD4507D4F0A377FDE01A /* LoadableAvatarImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoadableAvatarImage.swift; sourceTree = ""; }; - B61C339A2FDDBD067FF6635C /* ConfettiScene.scn */ = {isa = PBXFileReference; lastKnownFileType = file.bplist; path = ConfettiScene.scn; sourceTree = ""; }; + B61C339A2FDDBD067FF6635C /* ConfettiScene.scn */ = {isa = PBXFileReference; path = ConfettiScene.scn; sourceTree = ""; }; B63B69F9A2BC74DD40DC75C8 /* AdvancedSettingsScreenViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdvancedSettingsScreenViewModel.swift; sourceTree = ""; }; B6404166CBF5CC88673FF9E2 /* RoomDetails.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomDetails.swift; sourceTree = ""; }; B655A536341D2695158C6664 /* AuthenticationClientBuilderFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthenticationClientBuilderFactory.swift; sourceTree = ""; }; @@ -2110,7 +2114,7 @@ CDB3227C7A74B734924942E9 /* RoomSummaryProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomSummaryProvider.swift; sourceTree = ""; }; CDE3F3911FF7CC639BDE5844 /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/Localizable.strings; sourceTree = ""; }; CEE20623EB4A9B88FB29F2BA /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/SAS.strings; sourceTree = ""; }; - CEE41494C837AA403A06A5D9 /* UnitTests.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = UnitTests.xctestplan; sourceTree = ""; }; + CEE41494C837AA403A06A5D9 /* UnitTests.xctestplan */ = {isa = PBXFileReference; path = UnitTests.xctestplan; sourceTree = ""; }; D071F86CD47582B9196C9D16 /* UserDiscoverySection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserDiscoverySection.swift; sourceTree = ""; }; D086854995173E897F993C26 /* AdvancedSettingsScreenViewModelProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdvancedSettingsScreenViewModelProtocol.swift; sourceTree = ""; }; D09A267106B9585D3D0CFC0D /* ClientError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClientError.swift; sourceTree = ""; }; @@ -2241,7 +2245,7 @@ ED0CBEAB5F796BEFBAF7BB6A /* VideoRoomTimelineView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VideoRoomTimelineView.swift; sourceTree = ""; }; ED1D792EB82506A19A72C8DE /* RoomTimelineItemProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomTimelineItemProtocol.swift; sourceTree = ""; }; ED33988DA4FD4FC666800106 /* SessionVerificationScreenViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SessionVerificationScreenViewModel.swift; sourceTree = ""; }; - ED482057AE39D5C6D9C5F3D8 /* message.caf */ = {isa = PBXFileReference; lastKnownFileType = file; path = message.caf; sourceTree = ""; }; + ED482057AE39D5C6D9C5F3D8 /* message.caf */ = {isa = PBXFileReference; path = message.caf; sourceTree = ""; }; ED49073BB1C1FC649DAC2CCD /* LocationRoomTimelineView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocationRoomTimelineView.swift; sourceTree = ""; }; ED60E4D2CD678E1EBF16F77A /* BlockedUsersScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BlockedUsersScreen.swift; sourceTree = ""; }; EE378083653EF0C9B5E9D580 /* EmoteRoomTimelineItemContent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmoteRoomTimelineItemContent.swift; sourceTree = ""; }; @@ -2263,7 +2267,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; lastKnownFileType = file; path = portrait_test_video.mp4; sourceTree = ""; }; + F2D513D2477B57F90E98EEC0 /* portrait_test_video.mp4 */ = {isa = PBXFileReference; path = portrait_test_video.mp4; sourceTree = ""; }; F2E4EF80DFB8FE7C4469B15D /* RoomDirectorySearchScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomDirectorySearchScreen.swift; 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 = ""; }; @@ -2903,7 +2907,6 @@ 31CE4DA53232AA534057F912 /* Mocks */ = { isa = PBXGroup; children = ( - A71F957E2CBFFD1F00FDBDF2 /* KnockedRoomProxyMock.swift */, 69CB8242D69B7E4D0B32E18D /* AggregatedReactionMock.swift */, 3BAC027034248429A438886B /* AppMediatorMock.swift */, 0554FEA301486A8CFA475D5A /* AuthenticationClientBuilderFactoryMock.swift */, @@ -2912,7 +2915,9 @@ 4E600B315B920B9687F8EE1B /* ComposerDraftServiceMock.swift */, E321E840DCC63790049984F4 /* ElementCallServiceMock.swift */, 1B10423B9102086A2D9BFCBA /* EventTimelineItem.swift */, + 3A21027F05874B1BCC3E452B /* InvitedRoomProxyMock.swift */, 867DC9530C42F7B5176BE465 /* JoinedRoomProxyMock.swift */, + 9E8F4D7D61B80EBD5CB92F8A /* KnockedRoomProxyMock.swift */, 6F65E4BB9E82EB8373207CF8 /* MediaProviderMock.swift */, 8DA1E8F287680C8ED25EDBAC /* NetworkMonitorMock.swift */, 382B50F7E379B3DBBD174364 /* NotificationSettingsProxyMock.swift */, @@ -3200,9 +3205,9 @@ 40E6246F03D1FE377BC5D963 /* Room */ = { isa = PBXGroup; children = ( - A71F957C2CBFF32A00FDBDF2 /* KnockedRoomProxy.swift */, 0E95B3BDB80531C85CD50AE6 /* InvitedRoomProxy.swift */, 07C6B0B087FE6601C3F77816 /* JoinedRoomProxy.swift */, + 858DA81F2ACF484B7CAD6AE4 /* KnockedRoomProxy.swift */, B6404166CBF5CC88673FF9E2 /* RoomDetails.swift */, 974AEAF3FE0C577A6C04AD6E /* RoomPermissions.swift */, 47111410B6E659A697D472B5 /* RoomProxyProtocol.swift */, @@ -3421,6 +3426,7 @@ A3B4B58B79A6FA250B24A1EC /* HomeScreenContent.swift */, C0FEA560929DD73FFEF8C3DF /* HomeScreenEmptyStateView.swift */, D8FC33C3F6BF597E095CE9FA /* HomeScreenInviteCell.swift */, + A103580EBA06155B1343EF16 /* HomeScreenKnockedCell.swift */, 05512FB13987D221B7205DE0 /* HomeScreenRecoveryKeyConfirmationBanner.swift */, ED044D00F2176681CC02CD54 /* HomeScreenRoomCell.swift */, C7661EFFCAA307A97D71132A /* HomeScreenRoomList.swift */, @@ -6456,7 +6462,6 @@ 46A6DB0F78FB399BD59E2D41 /* EncryptionKeyProviderProtocol.swift in Sources */, 0C6DF318E9C8F6461E6ABDE7 /* EncryptionResetPasswordScreen.swift in Sources */, 36926D795D6D19177C7812F8 /* EncryptionResetPasswordScreenCoordinator.swift in Sources */, - A71F957D2CBFF33100FDBDF2 /* KnockedRoomProxy.swift in Sources */, B1B255CE0E4306DD6E09D936 /* EncryptionResetPasswordScreenModels.swift in Sources */, D6152E21036B88C44ECB22E7 /* EncryptionResetPasswordScreenViewModel.swift in Sources */, A0601810597769B81C2358AF /* EncryptionResetPasswordScreenViewModelProtocol.swift in Sources */, @@ -6495,6 +6500,7 @@ 8CC12086CBF91A7E10CDC205 /* HomeScreenCoordinator.swift in Sources */, 77BB228AEA861E50FFD6A228 /* HomeScreenEmptyStateView.swift in Sources */, 22C5483D01EEB290B8339817 /* HomeScreenInviteCell.swift in Sources */, + 86DFA58FBBEB0AF671D2A1E1 /* HomeScreenKnockedCell.swift in Sources */, 8810A2A30A68252EBB54EE05 /* HomeScreenModels.swift in Sources */, B04E9EB589CE99C3929E817A /* HomeScreenRecoveryKeyConfirmationBanner.swift in Sources */, 0AE0AB1952F186EB86719B4F /* HomeScreenRoomCell.swift in Sources */, @@ -6526,6 +6532,7 @@ F519DE17A3A0F760307B2E6D /* InviteUsersScreenViewModel.swift in Sources */, A17FAD2EBC53E17B5FD384DB /* InviteUsersScreenViewModelProtocol.swift in Sources */, 89B909AC66B96FA054EF3C14 /* InvitedRoomProxy.swift in Sources */, + 07376A5274822EB45CC320C7 /* InvitedRoomProxyMock.swift in Sources */, 6A54F52443EC52AC5CD772C0 /* JoinRoomScreen.swift in Sources */, AFE2AB612A1460E49578D746 /* JoinRoomScreenCoordinator.swift in Sources */, DEDBD3E9CFCC9F20CAC79881 /* JoinRoomScreenModels.swift in Sources */, @@ -6537,6 +6544,8 @@ 1FE593ECEC40A43789105D80 /* KeychainController.swift in Sources */, FD29471C72872F8B7580E3E1 /* KeychainControllerMock.swift in Sources */, CB99B0FA38A4AC596F38CC13 /* KeychainControllerProtocol.swift in Sources */, + C969A62F3D9F14318481A33B /* KnockedRoomProxy.swift in Sources */, + 6681D6D3ADF69EBD2625F29A /* KnockedRoomProxyMock.swift in Sources */, 454F8DDC4442C0DE54094902 /* LABiometryType.swift in Sources */, E468CC731C3F4D678499E52F /* LAContextMock.swift in Sources */, D5681C80D8281560AACE0035 /* Label.swift in Sources */, @@ -6614,7 +6623,6 @@ EA01A06EEDFEF4AE7652E5F3 /* NSRegularExpresion.swift in Sources */, FA2BBAE9FC5E2E9F960C0980 /* NavigationCoordinators.swift in Sources */, 71C1347F23868324A4F43940 /* NavigationModule.swift in Sources */, - A71F957F2CBFFD2500FDBDF2 /* KnockedRoomProxyMock.swift in Sources */, B5E455C9689EA600EDB3E9E0 /* NavigationRootCoordinator.swift in Sources */, 93BAF04D9CCBC0A8841414D0 /* NetworkMonitor.swift in Sources */, 96B3606E30F824095B1DD022 /* NetworkMonitorMock.swift in Sources */, @@ -7285,7 +7293,9 @@ "@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; @@ -7334,7 +7344,9 @@ "@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)"; @@ -7360,7 +7372,9 @@ "@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)"; @@ -7605,7 +7619,9 @@ "@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; @@ -7806,7 +7822,7 @@ repositoryURL = "https://github.com/element-hq/matrix-rust-components-swift"; requirement = { kind = exactVersion; - version = 1.0.58; + version = 1.0.60; }; }; 701C7BEF8F70F7A83E852DCC /* XCRemoteSwiftPackageReference "GZIP" */ = { diff --git a/ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 0c07855fa0..c011f4376f 100644 --- a/ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -149,8 +149,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/element-hq/matrix-rust-components-swift", "state" : { - "revision" : "753c5381ce88b3549cbd8ed9b839109ff143ecdd", - "version" : "1.0.58" + "revision" : "dc3a2199b0e87824ccf06d1207487d2e49c5e584", + "version" : "1.0.60" } }, { diff --git a/ElementX/Sources/Mocks/Generated/GeneratedMocks.swift b/ElementX/Sources/Mocks/Generated/GeneratedMocks.swift index 039932ee7f..f2950f2ae6 100644 --- a/ElementX/Sources/Mocks/Generated/GeneratedMocks.swift +++ b/ElementX/Sources/Mocks/Generated/GeneratedMocks.swift @@ -2837,15 +2837,15 @@ class ClientProxyMock: ClientProxyProtocol { } //MARK: - knockRoom - var knockRoomMessageUnderlyingCallsCount = 0 - var knockRoomMessageCallsCount: Int { + var knockRoomMessageViaUnderlyingCallsCount = 0 + var knockRoomMessageViaCallsCount: Int { get { if Thread.isMainThread { - return knockRoomMessageUnderlyingCallsCount + return knockRoomMessageViaUnderlyingCallsCount } else { var returnValue: Int? = nil DispatchQueue.main.sync { - returnValue = knockRoomMessageUnderlyingCallsCount + returnValue = knockRoomMessageViaUnderlyingCallsCount } return returnValue! @@ -2853,29 +2853,29 @@ class ClientProxyMock: ClientProxyProtocol { } set { if Thread.isMainThread { - knockRoomMessageUnderlyingCallsCount = newValue + knockRoomMessageViaUnderlyingCallsCount = newValue } else { DispatchQueue.main.sync { - knockRoomMessageUnderlyingCallsCount = newValue + knockRoomMessageViaUnderlyingCallsCount = newValue } } } } - var knockRoomMessageCalled: Bool { - return knockRoomMessageCallsCount > 0 + var knockRoomMessageViaCalled: Bool { + return knockRoomMessageViaCallsCount > 0 } - var knockRoomMessageReceivedArguments: (roomID: String, message: String?)? - var knockRoomMessageReceivedInvocations: [(roomID: String, message: String?)] = [] + var knockRoomMessageViaReceivedArguments: (roomID: String, message: String?, via: [String])? + var knockRoomMessageViaReceivedInvocations: [(roomID: String, message: String?, via: [String])] = [] - var knockRoomMessageUnderlyingReturnValue: Result! - var knockRoomMessageReturnValue: Result! { + var knockRoomMessageViaUnderlyingReturnValue: Result! + var knockRoomMessageViaReturnValue: Result! { get { if Thread.isMainThread { - return knockRoomMessageUnderlyingReturnValue + return knockRoomMessageViaUnderlyingReturnValue } else { var returnValue: Result? = nil DispatchQueue.main.sync { - returnValue = knockRoomMessageUnderlyingReturnValue + returnValue = knockRoomMessageViaUnderlyingReturnValue } return returnValue! @@ -2883,26 +2883,26 @@ class ClientProxyMock: ClientProxyProtocol { } set { if Thread.isMainThread { - knockRoomMessageUnderlyingReturnValue = newValue + knockRoomMessageViaUnderlyingReturnValue = newValue } else { DispatchQueue.main.sync { - knockRoomMessageUnderlyingReturnValue = newValue + knockRoomMessageViaUnderlyingReturnValue = newValue } } } } - var knockRoomMessageClosure: ((String, String?) async -> Result)? + var knockRoomMessageViaClosure: ((String, String?, [String]) async -> Result)? - func knockRoom(_ roomID: String, message: String?) async -> Result { - knockRoomMessageCallsCount += 1 - knockRoomMessageReceivedArguments = (roomID: roomID, message: message) + func knockRoom(_ roomID: String, message: String?, via: [String]) async -> Result { + knockRoomMessageViaCallsCount += 1 + knockRoomMessageViaReceivedArguments = (roomID: roomID, message: message, via: via) DispatchQueue.main.async { - self.knockRoomMessageReceivedInvocations.append((roomID: roomID, message: message)) + self.knockRoomMessageViaReceivedInvocations.append((roomID: roomID, message: message, via: via)) } - if let knockRoomMessageClosure = knockRoomMessageClosure { - return await knockRoomMessageClosure(roomID, message) + if let knockRoomMessageViaClosure = knockRoomMessageViaClosure { + return await knockRoomMessageViaClosure(roomID, message, via) } else { - return knockRoomMessageReturnValue + return knockRoomMessageViaReturnValue } } //MARK: - knockRoomAlias diff --git a/ElementX/Sources/Mocks/Generated/SDKGeneratedMocks.swift b/ElementX/Sources/Mocks/Generated/SDKGeneratedMocks.swift index e9fa1ed9a0..efa0f5bb26 100644 --- a/ElementX/Sources/Mocks/Generated/SDKGeneratedMocks.swift +++ b/ElementX/Sources/Mocks/Generated/SDKGeneratedMocks.swift @@ -2208,16 +2208,16 @@ open class ClientSDKMock: MatrixRustSDK.Client { //MARK: - knock - open var knockRoomIdOrAliasReasonServerNamesThrowableError: Error? - var knockRoomIdOrAliasReasonServerNamesUnderlyingCallsCount = 0 - open var knockRoomIdOrAliasReasonServerNamesCallsCount: Int { + open var knockRoomIdOrAliasThrowableError: Error? + var knockRoomIdOrAliasUnderlyingCallsCount = 0 + open var knockRoomIdOrAliasCallsCount: Int { get { if Thread.isMainThread { - return knockRoomIdOrAliasReasonServerNamesUnderlyingCallsCount + return knockRoomIdOrAliasUnderlyingCallsCount } else { var returnValue: Int? = nil DispatchQueue.main.sync { - returnValue = knockRoomIdOrAliasReasonServerNamesUnderlyingCallsCount + returnValue = knockRoomIdOrAliasUnderlyingCallsCount } return returnValue! @@ -2225,29 +2225,29 @@ open class ClientSDKMock: MatrixRustSDK.Client { } set { if Thread.isMainThread { - knockRoomIdOrAliasReasonServerNamesUnderlyingCallsCount = newValue + knockRoomIdOrAliasUnderlyingCallsCount = newValue } else { DispatchQueue.main.sync { - knockRoomIdOrAliasReasonServerNamesUnderlyingCallsCount = newValue + knockRoomIdOrAliasUnderlyingCallsCount = newValue } } } } - open var knockRoomIdOrAliasReasonServerNamesCalled: Bool { - return knockRoomIdOrAliasReasonServerNamesCallsCount > 0 + open var knockRoomIdOrAliasCalled: Bool { + return knockRoomIdOrAliasCallsCount > 0 } - open var knockRoomIdOrAliasReasonServerNamesReceivedArguments: (roomIdOrAlias: String, reason: String?, serverNames: [String])? - open var knockRoomIdOrAliasReasonServerNamesReceivedInvocations: [(roomIdOrAlias: String, reason: String?, serverNames: [String])] = [] + open var knockRoomIdOrAliasReceivedRoomIdOrAlias: String? + open var knockRoomIdOrAliasReceivedInvocations: [String] = [] - var knockRoomIdOrAliasReasonServerNamesUnderlyingReturnValue: Room! - open var knockRoomIdOrAliasReasonServerNamesReturnValue: Room! { + var knockRoomIdOrAliasUnderlyingReturnValue: Room! + open var knockRoomIdOrAliasReturnValue: Room! { get { if Thread.isMainThread { - return knockRoomIdOrAliasReasonServerNamesUnderlyingReturnValue + return knockRoomIdOrAliasUnderlyingReturnValue } else { var returnValue: Room? = nil DispatchQueue.main.sync { - returnValue = knockRoomIdOrAliasReasonServerNamesUnderlyingReturnValue + returnValue = knockRoomIdOrAliasUnderlyingReturnValue } return returnValue! @@ -2255,29 +2255,29 @@ open class ClientSDKMock: MatrixRustSDK.Client { } set { if Thread.isMainThread { - knockRoomIdOrAliasReasonServerNamesUnderlyingReturnValue = newValue + knockRoomIdOrAliasUnderlyingReturnValue = newValue } else { DispatchQueue.main.sync { - knockRoomIdOrAliasReasonServerNamesUnderlyingReturnValue = newValue + knockRoomIdOrAliasUnderlyingReturnValue = newValue } } } } - open var knockRoomIdOrAliasReasonServerNamesClosure: ((String, String?, [String]) async throws -> Room)? + open var knockRoomIdOrAliasClosure: ((String) async throws -> Room)? - open override func knock(roomIdOrAlias: String, reason: String?, serverNames: [String]) async throws -> Room { - if let error = knockRoomIdOrAliasReasonServerNamesThrowableError { + open override func knock(roomIdOrAlias: String) async throws -> Room { + if let error = knockRoomIdOrAliasThrowableError { throw error } - knockRoomIdOrAliasReasonServerNamesCallsCount += 1 - knockRoomIdOrAliasReasonServerNamesReceivedArguments = (roomIdOrAlias: roomIdOrAlias, reason: reason, serverNames: serverNames) + knockRoomIdOrAliasCallsCount += 1 + knockRoomIdOrAliasReceivedRoomIdOrAlias = roomIdOrAlias DispatchQueue.main.async { - self.knockRoomIdOrAliasReasonServerNamesReceivedInvocations.append((roomIdOrAlias: roomIdOrAlias, reason: reason, serverNames: serverNames)) + self.knockRoomIdOrAliasReceivedInvocations.append(roomIdOrAlias) } - if let knockRoomIdOrAliasReasonServerNamesClosure = knockRoomIdOrAliasReasonServerNamesClosure { - return try await knockRoomIdOrAliasReasonServerNamesClosure(roomIdOrAlias, reason, serverNames) + if let knockRoomIdOrAliasClosure = knockRoomIdOrAliasClosure { + return try await knockRoomIdOrAliasClosure(roomIdOrAlias) } else { - return knockRoomIdOrAliasReasonServerNamesReturnValue + return knockRoomIdOrAliasReturnValue } } @@ -6214,81 +6214,6 @@ open class EncryptionSDKMock: MatrixRustSDK.Encryption { } } - //MARK: - getUserIdentity - - open var getUserIdentityUserIdThrowableError: Error? - var getUserIdentityUserIdUnderlyingCallsCount = 0 - open var getUserIdentityUserIdCallsCount: Int { - get { - if Thread.isMainThread { - return getUserIdentityUserIdUnderlyingCallsCount - } else { - var returnValue: Int? = nil - DispatchQueue.main.sync { - returnValue = getUserIdentityUserIdUnderlyingCallsCount - } - - return returnValue! - } - } - set { - if Thread.isMainThread { - getUserIdentityUserIdUnderlyingCallsCount = newValue - } else { - DispatchQueue.main.sync { - getUserIdentityUserIdUnderlyingCallsCount = newValue - } - } - } - } - open var getUserIdentityUserIdCalled: Bool { - return getUserIdentityUserIdCallsCount > 0 - } - open var getUserIdentityUserIdReceivedUserId: String? - open var getUserIdentityUserIdReceivedInvocations: [String] = [] - - var getUserIdentityUserIdUnderlyingReturnValue: UserIdentity? - open var getUserIdentityUserIdReturnValue: UserIdentity? { - get { - if Thread.isMainThread { - return getUserIdentityUserIdUnderlyingReturnValue - } else { - var returnValue: UserIdentity?? = nil - DispatchQueue.main.sync { - returnValue = getUserIdentityUserIdUnderlyingReturnValue - } - - return returnValue! - } - } - set { - if Thread.isMainThread { - getUserIdentityUserIdUnderlyingReturnValue = newValue - } else { - DispatchQueue.main.sync { - getUserIdentityUserIdUnderlyingReturnValue = newValue - } - } - } - } - open var getUserIdentityUserIdClosure: ((String) async throws -> UserIdentity?)? - - open override func getUserIdentity(userId: String) async throws -> UserIdentity? { - if let error = getUserIdentityUserIdThrowableError { - throw error - } - getUserIdentityUserIdCallsCount += 1 - getUserIdentityUserIdReceivedUserId = userId - DispatchQueue.main.async { - self.getUserIdentityUserIdReceivedInvocations.append(userId) - } - if let getUserIdentityUserIdClosure = getUserIdentityUserIdClosure { - return try await getUserIdentityUserIdClosure(userId) - } else { - return getUserIdentityUserIdReturnValue - } - } - //MARK: - isLastDevice open var isLastDeviceThrowableError: Error? @@ -6753,6 +6678,81 @@ open class EncryptionSDKMock: MatrixRustSDK.Encryption { } } + //MARK: - userIdentity + + open var userIdentityUserIdThrowableError: Error? + var userIdentityUserIdUnderlyingCallsCount = 0 + open var userIdentityUserIdCallsCount: Int { + get { + if Thread.isMainThread { + return userIdentityUserIdUnderlyingCallsCount + } else { + var returnValue: Int? = nil + DispatchQueue.main.sync { + returnValue = userIdentityUserIdUnderlyingCallsCount + } + + return returnValue! + } + } + set { + if Thread.isMainThread { + userIdentityUserIdUnderlyingCallsCount = newValue + } else { + DispatchQueue.main.sync { + userIdentityUserIdUnderlyingCallsCount = newValue + } + } + } + } + open var userIdentityUserIdCalled: Bool { + return userIdentityUserIdCallsCount > 0 + } + open var userIdentityUserIdReceivedUserId: String? + open var userIdentityUserIdReceivedInvocations: [String] = [] + + var userIdentityUserIdUnderlyingReturnValue: UserIdentity? + open var userIdentityUserIdReturnValue: UserIdentity? { + get { + if Thread.isMainThread { + return userIdentityUserIdUnderlyingReturnValue + } else { + var returnValue: UserIdentity?? = nil + DispatchQueue.main.sync { + returnValue = userIdentityUserIdUnderlyingReturnValue + } + + return returnValue! + } + } + set { + if Thread.isMainThread { + userIdentityUserIdUnderlyingReturnValue = newValue + } else { + DispatchQueue.main.sync { + userIdentityUserIdUnderlyingReturnValue = newValue + } + } + } + } + open var userIdentityUserIdClosure: ((String) async throws -> UserIdentity?)? + + open override func userIdentity(userId: String) async throws -> UserIdentity? { + if let error = userIdentityUserIdThrowableError { + throw error + } + userIdentityUserIdCallsCount += 1 + userIdentityUserIdReceivedUserId = userId + DispatchQueue.main.async { + self.userIdentityUserIdReceivedInvocations.append(userId) + } + if let userIdentityUserIdClosure = userIdentityUserIdClosure { + return try await userIdentityUserIdClosure(userId) + } else { + return userIdentityUserIdReturnValue + } + } + //MARK: - verificationState var verificationStateUnderlyingCallsCount = 0 @@ -16007,16 +16007,16 @@ open class RoomListServiceSDKMock: MatrixRustSDK.RoomListService { //MARK: - subscribeToRooms - open var subscribeToRoomsRoomIdsSettingsThrowableError: Error? - var subscribeToRoomsRoomIdsSettingsUnderlyingCallsCount = 0 - open var subscribeToRoomsRoomIdsSettingsCallsCount: Int { + open var subscribeToRoomsRoomIdsThrowableError: Error? + var subscribeToRoomsRoomIdsUnderlyingCallsCount = 0 + open var subscribeToRoomsRoomIdsCallsCount: Int { get { if Thread.isMainThread { - return subscribeToRoomsRoomIdsSettingsUnderlyingCallsCount + return subscribeToRoomsRoomIdsUnderlyingCallsCount } else { var returnValue: Int? = nil DispatchQueue.main.sync { - returnValue = subscribeToRoomsRoomIdsSettingsUnderlyingCallsCount + returnValue = subscribeToRoomsRoomIdsUnderlyingCallsCount } return returnValue! @@ -16024,31 +16024,31 @@ open class RoomListServiceSDKMock: MatrixRustSDK.RoomListService { } set { if Thread.isMainThread { - subscribeToRoomsRoomIdsSettingsUnderlyingCallsCount = newValue + subscribeToRoomsRoomIdsUnderlyingCallsCount = newValue } else { DispatchQueue.main.sync { - subscribeToRoomsRoomIdsSettingsUnderlyingCallsCount = newValue + subscribeToRoomsRoomIdsUnderlyingCallsCount = newValue } } } } - open var subscribeToRoomsRoomIdsSettingsCalled: Bool { - return subscribeToRoomsRoomIdsSettingsCallsCount > 0 + open var subscribeToRoomsRoomIdsCalled: Bool { + return subscribeToRoomsRoomIdsCallsCount > 0 } - open var subscribeToRoomsRoomIdsSettingsReceivedArguments: (roomIds: [String], settings: RoomSubscription?)? - open var subscribeToRoomsRoomIdsSettingsReceivedInvocations: [(roomIds: [String], settings: RoomSubscription?)] = [] - open var subscribeToRoomsRoomIdsSettingsClosure: (([String], RoomSubscription?) throws -> Void)? + open var subscribeToRoomsRoomIdsReceivedRoomIds: [String]? + open var subscribeToRoomsRoomIdsReceivedInvocations: [[String]] = [] + open var subscribeToRoomsRoomIdsClosure: (([String]) throws -> Void)? - open override func subscribeToRooms(roomIds: [String], settings: RoomSubscription?) throws { - if let error = subscribeToRoomsRoomIdsSettingsThrowableError { + open override func subscribeToRooms(roomIds: [String]) throws { + if let error = subscribeToRoomsRoomIdsThrowableError { throw error } - subscribeToRoomsRoomIdsSettingsCallsCount += 1 - subscribeToRoomsRoomIdsSettingsReceivedArguments = (roomIds: roomIds, settings: settings) + subscribeToRoomsRoomIdsCallsCount += 1 + subscribeToRoomsRoomIdsReceivedRoomIds = roomIds DispatchQueue.main.async { - self.subscribeToRoomsRoomIdsSettingsReceivedInvocations.append((roomIds: roomIds, settings: settings)) + self.subscribeToRoomsRoomIdsReceivedInvocations.append(roomIds) } - try subscribeToRoomsRoomIdsSettingsClosure?(roomIds, settings) + try subscribeToRoomsRoomIdsClosure?(roomIds) } //MARK: - syncIndicator @@ -18334,81 +18334,6 @@ open class TimelineSDKMock: MatrixRustSDK.Timeline { } } - //MARK: - getEventTimelineItemByTransactionId - - open var getEventTimelineItemByTransactionIdTransactionIdThrowableError: Error? - var getEventTimelineItemByTransactionIdTransactionIdUnderlyingCallsCount = 0 - open var getEventTimelineItemByTransactionIdTransactionIdCallsCount: Int { - get { - if Thread.isMainThread { - return getEventTimelineItemByTransactionIdTransactionIdUnderlyingCallsCount - } else { - var returnValue: Int? = nil - DispatchQueue.main.sync { - returnValue = getEventTimelineItemByTransactionIdTransactionIdUnderlyingCallsCount - } - - return returnValue! - } - } - set { - if Thread.isMainThread { - getEventTimelineItemByTransactionIdTransactionIdUnderlyingCallsCount = newValue - } else { - DispatchQueue.main.sync { - getEventTimelineItemByTransactionIdTransactionIdUnderlyingCallsCount = newValue - } - } - } - } - open var getEventTimelineItemByTransactionIdTransactionIdCalled: Bool { - return getEventTimelineItemByTransactionIdTransactionIdCallsCount > 0 - } - open var getEventTimelineItemByTransactionIdTransactionIdReceivedTransactionId: String? - open var getEventTimelineItemByTransactionIdTransactionIdReceivedInvocations: [String] = [] - - var getEventTimelineItemByTransactionIdTransactionIdUnderlyingReturnValue: EventTimelineItem! - open var getEventTimelineItemByTransactionIdTransactionIdReturnValue: EventTimelineItem! { - get { - if Thread.isMainThread { - return getEventTimelineItemByTransactionIdTransactionIdUnderlyingReturnValue - } else { - var returnValue: EventTimelineItem? = nil - DispatchQueue.main.sync { - returnValue = getEventTimelineItemByTransactionIdTransactionIdUnderlyingReturnValue - } - - return returnValue! - } - } - set { - if Thread.isMainThread { - getEventTimelineItemByTransactionIdTransactionIdUnderlyingReturnValue = newValue - } else { - DispatchQueue.main.sync { - getEventTimelineItemByTransactionIdTransactionIdUnderlyingReturnValue = newValue - } - } - } - } - open var getEventTimelineItemByTransactionIdTransactionIdClosure: ((String) async throws -> EventTimelineItem)? - - open override func getEventTimelineItemByTransactionId(transactionId: String) async throws -> EventTimelineItem { - if let error = getEventTimelineItemByTransactionIdTransactionIdThrowableError { - throw error - } - getEventTimelineItemByTransactionIdTransactionIdCallsCount += 1 - getEventTimelineItemByTransactionIdTransactionIdReceivedTransactionId = transactionId - DispatchQueue.main.async { - self.getEventTimelineItemByTransactionIdTransactionIdReceivedInvocations.append(transactionId) - } - if let getEventTimelineItemByTransactionIdTransactionIdClosure = getEventTimelineItemByTransactionIdTransactionIdClosure { - return try await getEventTimelineItemByTransactionIdTransactionIdClosure(transactionId) - } else { - return getEventTimelineItemByTransactionIdTransactionIdReturnValue - } - } - //MARK: - loadReplyDetails open var loadReplyDetailsEventIdStrThrowableError: Error? @@ -18845,15 +18770,15 @@ open class TimelineSDKMock: MatrixRustSDK.Timeline { //MARK: - sendAudio - var sendAudioUrlAudioInfoCaptionFormattedCaptionProgressWatcherUnderlyingCallsCount = 0 - open var sendAudioUrlAudioInfoCaptionFormattedCaptionProgressWatcherCallsCount: Int { + var sendAudioUrlAudioInfoCaptionFormattedCaptionStoreInCacheProgressWatcherUnderlyingCallsCount = 0 + open var sendAudioUrlAudioInfoCaptionFormattedCaptionStoreInCacheProgressWatcherCallsCount: Int { get { if Thread.isMainThread { - return sendAudioUrlAudioInfoCaptionFormattedCaptionProgressWatcherUnderlyingCallsCount + return sendAudioUrlAudioInfoCaptionFormattedCaptionStoreInCacheProgressWatcherUnderlyingCallsCount } else { var returnValue: Int? = nil DispatchQueue.main.sync { - returnValue = sendAudioUrlAudioInfoCaptionFormattedCaptionProgressWatcherUnderlyingCallsCount + returnValue = sendAudioUrlAudioInfoCaptionFormattedCaptionStoreInCacheProgressWatcherUnderlyingCallsCount } return returnValue! @@ -18861,29 +18786,29 @@ open class TimelineSDKMock: MatrixRustSDK.Timeline { } set { if Thread.isMainThread { - sendAudioUrlAudioInfoCaptionFormattedCaptionProgressWatcherUnderlyingCallsCount = newValue + sendAudioUrlAudioInfoCaptionFormattedCaptionStoreInCacheProgressWatcherUnderlyingCallsCount = newValue } else { DispatchQueue.main.sync { - sendAudioUrlAudioInfoCaptionFormattedCaptionProgressWatcherUnderlyingCallsCount = newValue + sendAudioUrlAudioInfoCaptionFormattedCaptionStoreInCacheProgressWatcherUnderlyingCallsCount = newValue } } } } - open var sendAudioUrlAudioInfoCaptionFormattedCaptionProgressWatcherCalled: Bool { - return sendAudioUrlAudioInfoCaptionFormattedCaptionProgressWatcherCallsCount > 0 + open var sendAudioUrlAudioInfoCaptionFormattedCaptionStoreInCacheProgressWatcherCalled: Bool { + return sendAudioUrlAudioInfoCaptionFormattedCaptionStoreInCacheProgressWatcherCallsCount > 0 } - open var sendAudioUrlAudioInfoCaptionFormattedCaptionProgressWatcherReceivedArguments: (url: String, audioInfo: AudioInfo, caption: String?, formattedCaption: FormattedBody?, progressWatcher: ProgressWatcher?)? - open var sendAudioUrlAudioInfoCaptionFormattedCaptionProgressWatcherReceivedInvocations: [(url: String, audioInfo: AudioInfo, caption: String?, formattedCaption: FormattedBody?, progressWatcher: ProgressWatcher?)] = [] + open var sendAudioUrlAudioInfoCaptionFormattedCaptionStoreInCacheProgressWatcherReceivedArguments: (url: String, audioInfo: AudioInfo, caption: String?, formattedCaption: FormattedBody?, storeInCache: Bool, progressWatcher: ProgressWatcher?)? + open var sendAudioUrlAudioInfoCaptionFormattedCaptionStoreInCacheProgressWatcherReceivedInvocations: [(url: String, audioInfo: AudioInfo, caption: String?, formattedCaption: FormattedBody?, storeInCache: Bool, progressWatcher: ProgressWatcher?)] = [] - var sendAudioUrlAudioInfoCaptionFormattedCaptionProgressWatcherUnderlyingReturnValue: SendAttachmentJoinHandle! - open var sendAudioUrlAudioInfoCaptionFormattedCaptionProgressWatcherReturnValue: SendAttachmentJoinHandle! { + var sendAudioUrlAudioInfoCaptionFormattedCaptionStoreInCacheProgressWatcherUnderlyingReturnValue: SendAttachmentJoinHandle! + open var sendAudioUrlAudioInfoCaptionFormattedCaptionStoreInCacheProgressWatcherReturnValue: SendAttachmentJoinHandle! { get { if Thread.isMainThread { - return sendAudioUrlAudioInfoCaptionFormattedCaptionProgressWatcherUnderlyingReturnValue + return sendAudioUrlAudioInfoCaptionFormattedCaptionStoreInCacheProgressWatcherUnderlyingReturnValue } else { var returnValue: SendAttachmentJoinHandle? = nil DispatchQueue.main.sync { - returnValue = sendAudioUrlAudioInfoCaptionFormattedCaptionProgressWatcherUnderlyingReturnValue + returnValue = sendAudioUrlAudioInfoCaptionFormattedCaptionStoreInCacheProgressWatcherUnderlyingReturnValue } return returnValue! @@ -18891,40 +18816,40 @@ open class TimelineSDKMock: MatrixRustSDK.Timeline { } set { if Thread.isMainThread { - sendAudioUrlAudioInfoCaptionFormattedCaptionProgressWatcherUnderlyingReturnValue = newValue + sendAudioUrlAudioInfoCaptionFormattedCaptionStoreInCacheProgressWatcherUnderlyingReturnValue = newValue } else { DispatchQueue.main.sync { - sendAudioUrlAudioInfoCaptionFormattedCaptionProgressWatcherUnderlyingReturnValue = newValue + sendAudioUrlAudioInfoCaptionFormattedCaptionStoreInCacheProgressWatcherUnderlyingReturnValue = newValue } } } } - open var sendAudioUrlAudioInfoCaptionFormattedCaptionProgressWatcherClosure: ((String, AudioInfo, String?, FormattedBody?, ProgressWatcher?) -> SendAttachmentJoinHandle)? + open var sendAudioUrlAudioInfoCaptionFormattedCaptionStoreInCacheProgressWatcherClosure: ((String, AudioInfo, String?, FormattedBody?, Bool, ProgressWatcher?) -> SendAttachmentJoinHandle)? - open override func sendAudio(url: String, audioInfo: AudioInfo, caption: String?, formattedCaption: FormattedBody?, progressWatcher: ProgressWatcher?) -> SendAttachmentJoinHandle { - sendAudioUrlAudioInfoCaptionFormattedCaptionProgressWatcherCallsCount += 1 - sendAudioUrlAudioInfoCaptionFormattedCaptionProgressWatcherReceivedArguments = (url: url, audioInfo: audioInfo, caption: caption, formattedCaption: formattedCaption, progressWatcher: progressWatcher) + open override func sendAudio(url: String, audioInfo: AudioInfo, caption: String?, formattedCaption: FormattedBody?, storeInCache: Bool, progressWatcher: ProgressWatcher?) -> SendAttachmentJoinHandle { + sendAudioUrlAudioInfoCaptionFormattedCaptionStoreInCacheProgressWatcherCallsCount += 1 + sendAudioUrlAudioInfoCaptionFormattedCaptionStoreInCacheProgressWatcherReceivedArguments = (url: url, audioInfo: audioInfo, caption: caption, formattedCaption: formattedCaption, storeInCache: storeInCache, progressWatcher: progressWatcher) DispatchQueue.main.async { - self.sendAudioUrlAudioInfoCaptionFormattedCaptionProgressWatcherReceivedInvocations.append((url: url, audioInfo: audioInfo, caption: caption, formattedCaption: formattedCaption, progressWatcher: progressWatcher)) + self.sendAudioUrlAudioInfoCaptionFormattedCaptionStoreInCacheProgressWatcherReceivedInvocations.append((url: url, audioInfo: audioInfo, caption: caption, formattedCaption: formattedCaption, storeInCache: storeInCache, progressWatcher: progressWatcher)) } - if let sendAudioUrlAudioInfoCaptionFormattedCaptionProgressWatcherClosure = sendAudioUrlAudioInfoCaptionFormattedCaptionProgressWatcherClosure { - return sendAudioUrlAudioInfoCaptionFormattedCaptionProgressWatcherClosure(url, audioInfo, caption, formattedCaption, progressWatcher) + if let sendAudioUrlAudioInfoCaptionFormattedCaptionStoreInCacheProgressWatcherClosure = sendAudioUrlAudioInfoCaptionFormattedCaptionStoreInCacheProgressWatcherClosure { + return sendAudioUrlAudioInfoCaptionFormattedCaptionStoreInCacheProgressWatcherClosure(url, audioInfo, caption, formattedCaption, storeInCache, progressWatcher) } else { - return sendAudioUrlAudioInfoCaptionFormattedCaptionProgressWatcherReturnValue + return sendAudioUrlAudioInfoCaptionFormattedCaptionStoreInCacheProgressWatcherReturnValue } } //MARK: - sendFile - var sendFileUrlFileInfoProgressWatcherUnderlyingCallsCount = 0 - open var sendFileUrlFileInfoProgressWatcherCallsCount: Int { + var sendFileUrlFileInfoStoreInCacheProgressWatcherUnderlyingCallsCount = 0 + open var sendFileUrlFileInfoStoreInCacheProgressWatcherCallsCount: Int { get { if Thread.isMainThread { - return sendFileUrlFileInfoProgressWatcherUnderlyingCallsCount + return sendFileUrlFileInfoStoreInCacheProgressWatcherUnderlyingCallsCount } else { var returnValue: Int? = nil DispatchQueue.main.sync { - returnValue = sendFileUrlFileInfoProgressWatcherUnderlyingCallsCount + returnValue = sendFileUrlFileInfoStoreInCacheProgressWatcherUnderlyingCallsCount } return returnValue! @@ -18932,29 +18857,29 @@ open class TimelineSDKMock: MatrixRustSDK.Timeline { } set { if Thread.isMainThread { - sendFileUrlFileInfoProgressWatcherUnderlyingCallsCount = newValue + sendFileUrlFileInfoStoreInCacheProgressWatcherUnderlyingCallsCount = newValue } else { DispatchQueue.main.sync { - sendFileUrlFileInfoProgressWatcherUnderlyingCallsCount = newValue + sendFileUrlFileInfoStoreInCacheProgressWatcherUnderlyingCallsCount = newValue } } } } - open var sendFileUrlFileInfoProgressWatcherCalled: Bool { - return sendFileUrlFileInfoProgressWatcherCallsCount > 0 + open var sendFileUrlFileInfoStoreInCacheProgressWatcherCalled: Bool { + return sendFileUrlFileInfoStoreInCacheProgressWatcherCallsCount > 0 } - open var sendFileUrlFileInfoProgressWatcherReceivedArguments: (url: String, fileInfo: FileInfo, progressWatcher: ProgressWatcher?)? - open var sendFileUrlFileInfoProgressWatcherReceivedInvocations: [(url: String, fileInfo: FileInfo, progressWatcher: ProgressWatcher?)] = [] + open var sendFileUrlFileInfoStoreInCacheProgressWatcherReceivedArguments: (url: String, fileInfo: FileInfo, storeInCache: Bool, progressWatcher: ProgressWatcher?)? + open var sendFileUrlFileInfoStoreInCacheProgressWatcherReceivedInvocations: [(url: String, fileInfo: FileInfo, storeInCache: Bool, progressWatcher: ProgressWatcher?)] = [] - var sendFileUrlFileInfoProgressWatcherUnderlyingReturnValue: SendAttachmentJoinHandle! - open var sendFileUrlFileInfoProgressWatcherReturnValue: SendAttachmentJoinHandle! { + var sendFileUrlFileInfoStoreInCacheProgressWatcherUnderlyingReturnValue: SendAttachmentJoinHandle! + open var sendFileUrlFileInfoStoreInCacheProgressWatcherReturnValue: SendAttachmentJoinHandle! { get { if Thread.isMainThread { - return sendFileUrlFileInfoProgressWatcherUnderlyingReturnValue + return sendFileUrlFileInfoStoreInCacheProgressWatcherUnderlyingReturnValue } else { var returnValue: SendAttachmentJoinHandle? = nil DispatchQueue.main.sync { - returnValue = sendFileUrlFileInfoProgressWatcherUnderlyingReturnValue + returnValue = sendFileUrlFileInfoStoreInCacheProgressWatcherUnderlyingReturnValue } return returnValue! @@ -18962,40 +18887,40 @@ open class TimelineSDKMock: MatrixRustSDK.Timeline { } set { if Thread.isMainThread { - sendFileUrlFileInfoProgressWatcherUnderlyingReturnValue = newValue + sendFileUrlFileInfoStoreInCacheProgressWatcherUnderlyingReturnValue = newValue } else { DispatchQueue.main.sync { - sendFileUrlFileInfoProgressWatcherUnderlyingReturnValue = newValue + sendFileUrlFileInfoStoreInCacheProgressWatcherUnderlyingReturnValue = newValue } } } } - open var sendFileUrlFileInfoProgressWatcherClosure: ((String, FileInfo, ProgressWatcher?) -> SendAttachmentJoinHandle)? + open var sendFileUrlFileInfoStoreInCacheProgressWatcherClosure: ((String, FileInfo, Bool, ProgressWatcher?) -> SendAttachmentJoinHandle)? - open override func sendFile(url: String, fileInfo: FileInfo, progressWatcher: ProgressWatcher?) -> SendAttachmentJoinHandle { - sendFileUrlFileInfoProgressWatcherCallsCount += 1 - sendFileUrlFileInfoProgressWatcherReceivedArguments = (url: url, fileInfo: fileInfo, progressWatcher: progressWatcher) + open override func sendFile(url: String, fileInfo: FileInfo, storeInCache: Bool, progressWatcher: ProgressWatcher?) -> SendAttachmentJoinHandle { + sendFileUrlFileInfoStoreInCacheProgressWatcherCallsCount += 1 + sendFileUrlFileInfoStoreInCacheProgressWatcherReceivedArguments = (url: url, fileInfo: fileInfo, storeInCache: storeInCache, progressWatcher: progressWatcher) DispatchQueue.main.async { - self.sendFileUrlFileInfoProgressWatcherReceivedInvocations.append((url: url, fileInfo: fileInfo, progressWatcher: progressWatcher)) + self.sendFileUrlFileInfoStoreInCacheProgressWatcherReceivedInvocations.append((url: url, fileInfo: fileInfo, storeInCache: storeInCache, progressWatcher: progressWatcher)) } - if let sendFileUrlFileInfoProgressWatcherClosure = sendFileUrlFileInfoProgressWatcherClosure { - return sendFileUrlFileInfoProgressWatcherClosure(url, fileInfo, progressWatcher) + if let sendFileUrlFileInfoStoreInCacheProgressWatcherClosure = sendFileUrlFileInfoStoreInCacheProgressWatcherClosure { + return sendFileUrlFileInfoStoreInCacheProgressWatcherClosure(url, fileInfo, storeInCache, progressWatcher) } else { - return sendFileUrlFileInfoProgressWatcherReturnValue + return sendFileUrlFileInfoStoreInCacheProgressWatcherReturnValue } } //MARK: - sendImage - var sendImageUrlThumbnailUrlImageInfoCaptionFormattedCaptionProgressWatcherUnderlyingCallsCount = 0 - open var sendImageUrlThumbnailUrlImageInfoCaptionFormattedCaptionProgressWatcherCallsCount: Int { + var sendImageUrlThumbnailUrlImageInfoCaptionFormattedCaptionStoreInCacheProgressWatcherUnderlyingCallsCount = 0 + open var sendImageUrlThumbnailUrlImageInfoCaptionFormattedCaptionStoreInCacheProgressWatcherCallsCount: Int { get { if Thread.isMainThread { - return sendImageUrlThumbnailUrlImageInfoCaptionFormattedCaptionProgressWatcherUnderlyingCallsCount + return sendImageUrlThumbnailUrlImageInfoCaptionFormattedCaptionStoreInCacheProgressWatcherUnderlyingCallsCount } else { var returnValue: Int? = nil DispatchQueue.main.sync { - returnValue = sendImageUrlThumbnailUrlImageInfoCaptionFormattedCaptionProgressWatcherUnderlyingCallsCount + returnValue = sendImageUrlThumbnailUrlImageInfoCaptionFormattedCaptionStoreInCacheProgressWatcherUnderlyingCallsCount } return returnValue! @@ -19003,29 +18928,29 @@ open class TimelineSDKMock: MatrixRustSDK.Timeline { } set { if Thread.isMainThread { - sendImageUrlThumbnailUrlImageInfoCaptionFormattedCaptionProgressWatcherUnderlyingCallsCount = newValue + sendImageUrlThumbnailUrlImageInfoCaptionFormattedCaptionStoreInCacheProgressWatcherUnderlyingCallsCount = newValue } else { DispatchQueue.main.sync { - sendImageUrlThumbnailUrlImageInfoCaptionFormattedCaptionProgressWatcherUnderlyingCallsCount = newValue + sendImageUrlThumbnailUrlImageInfoCaptionFormattedCaptionStoreInCacheProgressWatcherUnderlyingCallsCount = newValue } } } } - open var sendImageUrlThumbnailUrlImageInfoCaptionFormattedCaptionProgressWatcherCalled: Bool { - return sendImageUrlThumbnailUrlImageInfoCaptionFormattedCaptionProgressWatcherCallsCount > 0 + open var sendImageUrlThumbnailUrlImageInfoCaptionFormattedCaptionStoreInCacheProgressWatcherCalled: Bool { + return sendImageUrlThumbnailUrlImageInfoCaptionFormattedCaptionStoreInCacheProgressWatcherCallsCount > 0 } - open var sendImageUrlThumbnailUrlImageInfoCaptionFormattedCaptionProgressWatcherReceivedArguments: (url: String, thumbnailUrl: String?, imageInfo: ImageInfo, caption: String?, formattedCaption: FormattedBody?, progressWatcher: ProgressWatcher?)? - open var sendImageUrlThumbnailUrlImageInfoCaptionFormattedCaptionProgressWatcherReceivedInvocations: [(url: String, thumbnailUrl: String?, imageInfo: ImageInfo, caption: String?, formattedCaption: FormattedBody?, progressWatcher: ProgressWatcher?)] = [] + open var sendImageUrlThumbnailUrlImageInfoCaptionFormattedCaptionStoreInCacheProgressWatcherReceivedArguments: (url: String, thumbnailUrl: String?, imageInfo: ImageInfo, caption: String?, formattedCaption: FormattedBody?, storeInCache: Bool, progressWatcher: ProgressWatcher?)? + open var sendImageUrlThumbnailUrlImageInfoCaptionFormattedCaptionStoreInCacheProgressWatcherReceivedInvocations: [(url: String, thumbnailUrl: String?, imageInfo: ImageInfo, caption: String?, formattedCaption: FormattedBody?, storeInCache: Bool, progressWatcher: ProgressWatcher?)] = [] - var sendImageUrlThumbnailUrlImageInfoCaptionFormattedCaptionProgressWatcherUnderlyingReturnValue: SendAttachmentJoinHandle! - open var sendImageUrlThumbnailUrlImageInfoCaptionFormattedCaptionProgressWatcherReturnValue: SendAttachmentJoinHandle! { + var sendImageUrlThumbnailUrlImageInfoCaptionFormattedCaptionStoreInCacheProgressWatcherUnderlyingReturnValue: SendAttachmentJoinHandle! + open var sendImageUrlThumbnailUrlImageInfoCaptionFormattedCaptionStoreInCacheProgressWatcherReturnValue: SendAttachmentJoinHandle! { get { if Thread.isMainThread { - return sendImageUrlThumbnailUrlImageInfoCaptionFormattedCaptionProgressWatcherUnderlyingReturnValue + return sendImageUrlThumbnailUrlImageInfoCaptionFormattedCaptionStoreInCacheProgressWatcherUnderlyingReturnValue } else { var returnValue: SendAttachmentJoinHandle? = nil DispatchQueue.main.sync { - returnValue = sendImageUrlThumbnailUrlImageInfoCaptionFormattedCaptionProgressWatcherUnderlyingReturnValue + returnValue = sendImageUrlThumbnailUrlImageInfoCaptionFormattedCaptionStoreInCacheProgressWatcherUnderlyingReturnValue } return returnValue! @@ -19033,26 +18958,26 @@ open class TimelineSDKMock: MatrixRustSDK.Timeline { } set { if Thread.isMainThread { - sendImageUrlThumbnailUrlImageInfoCaptionFormattedCaptionProgressWatcherUnderlyingReturnValue = newValue + sendImageUrlThumbnailUrlImageInfoCaptionFormattedCaptionStoreInCacheProgressWatcherUnderlyingReturnValue = newValue } else { DispatchQueue.main.sync { - sendImageUrlThumbnailUrlImageInfoCaptionFormattedCaptionProgressWatcherUnderlyingReturnValue = newValue + sendImageUrlThumbnailUrlImageInfoCaptionFormattedCaptionStoreInCacheProgressWatcherUnderlyingReturnValue = newValue } } } } - open var sendImageUrlThumbnailUrlImageInfoCaptionFormattedCaptionProgressWatcherClosure: ((String, String?, ImageInfo, String?, FormattedBody?, ProgressWatcher?) -> SendAttachmentJoinHandle)? + open var sendImageUrlThumbnailUrlImageInfoCaptionFormattedCaptionStoreInCacheProgressWatcherClosure: ((String, String?, ImageInfo, String?, FormattedBody?, Bool, ProgressWatcher?) -> SendAttachmentJoinHandle)? - open override func sendImage(url: String, thumbnailUrl: String?, imageInfo: ImageInfo, caption: String?, formattedCaption: FormattedBody?, progressWatcher: ProgressWatcher?) -> SendAttachmentJoinHandle { - sendImageUrlThumbnailUrlImageInfoCaptionFormattedCaptionProgressWatcherCallsCount += 1 - sendImageUrlThumbnailUrlImageInfoCaptionFormattedCaptionProgressWatcherReceivedArguments = (url: url, thumbnailUrl: thumbnailUrl, imageInfo: imageInfo, caption: caption, formattedCaption: formattedCaption, progressWatcher: progressWatcher) + open override func sendImage(url: String, thumbnailUrl: String?, imageInfo: ImageInfo, caption: String?, formattedCaption: FormattedBody?, storeInCache: Bool, progressWatcher: ProgressWatcher?) -> SendAttachmentJoinHandle { + sendImageUrlThumbnailUrlImageInfoCaptionFormattedCaptionStoreInCacheProgressWatcherCallsCount += 1 + sendImageUrlThumbnailUrlImageInfoCaptionFormattedCaptionStoreInCacheProgressWatcherReceivedArguments = (url: url, thumbnailUrl: thumbnailUrl, imageInfo: imageInfo, caption: caption, formattedCaption: formattedCaption, storeInCache: storeInCache, progressWatcher: progressWatcher) DispatchQueue.main.async { - self.sendImageUrlThumbnailUrlImageInfoCaptionFormattedCaptionProgressWatcherReceivedInvocations.append((url: url, thumbnailUrl: thumbnailUrl, imageInfo: imageInfo, caption: caption, formattedCaption: formattedCaption, progressWatcher: progressWatcher)) + self.sendImageUrlThumbnailUrlImageInfoCaptionFormattedCaptionStoreInCacheProgressWatcherReceivedInvocations.append((url: url, thumbnailUrl: thumbnailUrl, imageInfo: imageInfo, caption: caption, formattedCaption: formattedCaption, storeInCache: storeInCache, progressWatcher: progressWatcher)) } - if let sendImageUrlThumbnailUrlImageInfoCaptionFormattedCaptionProgressWatcherClosure = sendImageUrlThumbnailUrlImageInfoCaptionFormattedCaptionProgressWatcherClosure { - return sendImageUrlThumbnailUrlImageInfoCaptionFormattedCaptionProgressWatcherClosure(url, thumbnailUrl, imageInfo, caption, formattedCaption, progressWatcher) + if let sendImageUrlThumbnailUrlImageInfoCaptionFormattedCaptionStoreInCacheProgressWatcherClosure = sendImageUrlThumbnailUrlImageInfoCaptionFormattedCaptionStoreInCacheProgressWatcherClosure { + return sendImageUrlThumbnailUrlImageInfoCaptionFormattedCaptionStoreInCacheProgressWatcherClosure(url, thumbnailUrl, imageInfo, caption, formattedCaption, storeInCache, progressWatcher) } else { - return sendImageUrlThumbnailUrlImageInfoCaptionFormattedCaptionProgressWatcherReturnValue + return sendImageUrlThumbnailUrlImageInfoCaptionFormattedCaptionStoreInCacheProgressWatcherReturnValue } } @@ -19238,15 +19163,15 @@ open class TimelineSDKMock: MatrixRustSDK.Timeline { //MARK: - sendVideo - var sendVideoUrlThumbnailUrlVideoInfoCaptionFormattedCaptionProgressWatcherUnderlyingCallsCount = 0 - open var sendVideoUrlThumbnailUrlVideoInfoCaptionFormattedCaptionProgressWatcherCallsCount: Int { + var sendVideoUrlThumbnailUrlVideoInfoCaptionFormattedCaptionStoreInCacheProgressWatcherUnderlyingCallsCount = 0 + open var sendVideoUrlThumbnailUrlVideoInfoCaptionFormattedCaptionStoreInCacheProgressWatcherCallsCount: Int { get { if Thread.isMainThread { - return sendVideoUrlThumbnailUrlVideoInfoCaptionFormattedCaptionProgressWatcherUnderlyingCallsCount + return sendVideoUrlThumbnailUrlVideoInfoCaptionFormattedCaptionStoreInCacheProgressWatcherUnderlyingCallsCount } else { var returnValue: Int? = nil DispatchQueue.main.sync { - returnValue = sendVideoUrlThumbnailUrlVideoInfoCaptionFormattedCaptionProgressWatcherUnderlyingCallsCount + returnValue = sendVideoUrlThumbnailUrlVideoInfoCaptionFormattedCaptionStoreInCacheProgressWatcherUnderlyingCallsCount } return returnValue! @@ -19254,29 +19179,29 @@ open class TimelineSDKMock: MatrixRustSDK.Timeline { } set { if Thread.isMainThread { - sendVideoUrlThumbnailUrlVideoInfoCaptionFormattedCaptionProgressWatcherUnderlyingCallsCount = newValue + sendVideoUrlThumbnailUrlVideoInfoCaptionFormattedCaptionStoreInCacheProgressWatcherUnderlyingCallsCount = newValue } else { DispatchQueue.main.sync { - sendVideoUrlThumbnailUrlVideoInfoCaptionFormattedCaptionProgressWatcherUnderlyingCallsCount = newValue + sendVideoUrlThumbnailUrlVideoInfoCaptionFormattedCaptionStoreInCacheProgressWatcherUnderlyingCallsCount = newValue } } } } - open var sendVideoUrlThumbnailUrlVideoInfoCaptionFormattedCaptionProgressWatcherCalled: Bool { - return sendVideoUrlThumbnailUrlVideoInfoCaptionFormattedCaptionProgressWatcherCallsCount > 0 + open var sendVideoUrlThumbnailUrlVideoInfoCaptionFormattedCaptionStoreInCacheProgressWatcherCalled: Bool { + return sendVideoUrlThumbnailUrlVideoInfoCaptionFormattedCaptionStoreInCacheProgressWatcherCallsCount > 0 } - open var sendVideoUrlThumbnailUrlVideoInfoCaptionFormattedCaptionProgressWatcherReceivedArguments: (url: String, thumbnailUrl: String?, videoInfo: VideoInfo, caption: String?, formattedCaption: FormattedBody?, progressWatcher: ProgressWatcher?)? - open var sendVideoUrlThumbnailUrlVideoInfoCaptionFormattedCaptionProgressWatcherReceivedInvocations: [(url: String, thumbnailUrl: String?, videoInfo: VideoInfo, caption: String?, formattedCaption: FormattedBody?, progressWatcher: ProgressWatcher?)] = [] + open var sendVideoUrlThumbnailUrlVideoInfoCaptionFormattedCaptionStoreInCacheProgressWatcherReceivedArguments: (url: String, thumbnailUrl: String?, videoInfo: VideoInfo, caption: String?, formattedCaption: FormattedBody?, storeInCache: Bool, progressWatcher: ProgressWatcher?)? + open var sendVideoUrlThumbnailUrlVideoInfoCaptionFormattedCaptionStoreInCacheProgressWatcherReceivedInvocations: [(url: String, thumbnailUrl: String?, videoInfo: VideoInfo, caption: String?, formattedCaption: FormattedBody?, storeInCache: Bool, progressWatcher: ProgressWatcher?)] = [] - var sendVideoUrlThumbnailUrlVideoInfoCaptionFormattedCaptionProgressWatcherUnderlyingReturnValue: SendAttachmentJoinHandle! - open var sendVideoUrlThumbnailUrlVideoInfoCaptionFormattedCaptionProgressWatcherReturnValue: SendAttachmentJoinHandle! { + var sendVideoUrlThumbnailUrlVideoInfoCaptionFormattedCaptionStoreInCacheProgressWatcherUnderlyingReturnValue: SendAttachmentJoinHandle! + open var sendVideoUrlThumbnailUrlVideoInfoCaptionFormattedCaptionStoreInCacheProgressWatcherReturnValue: SendAttachmentJoinHandle! { get { if Thread.isMainThread { - return sendVideoUrlThumbnailUrlVideoInfoCaptionFormattedCaptionProgressWatcherUnderlyingReturnValue + return sendVideoUrlThumbnailUrlVideoInfoCaptionFormattedCaptionStoreInCacheProgressWatcherUnderlyingReturnValue } else { var returnValue: SendAttachmentJoinHandle? = nil DispatchQueue.main.sync { - returnValue = sendVideoUrlThumbnailUrlVideoInfoCaptionFormattedCaptionProgressWatcherUnderlyingReturnValue + returnValue = sendVideoUrlThumbnailUrlVideoInfoCaptionFormattedCaptionStoreInCacheProgressWatcherUnderlyingReturnValue } return returnValue! @@ -19284,40 +19209,40 @@ open class TimelineSDKMock: MatrixRustSDK.Timeline { } set { if Thread.isMainThread { - sendVideoUrlThumbnailUrlVideoInfoCaptionFormattedCaptionProgressWatcherUnderlyingReturnValue = newValue + sendVideoUrlThumbnailUrlVideoInfoCaptionFormattedCaptionStoreInCacheProgressWatcherUnderlyingReturnValue = newValue } else { DispatchQueue.main.sync { - sendVideoUrlThumbnailUrlVideoInfoCaptionFormattedCaptionProgressWatcherUnderlyingReturnValue = newValue + sendVideoUrlThumbnailUrlVideoInfoCaptionFormattedCaptionStoreInCacheProgressWatcherUnderlyingReturnValue = newValue } } } } - open var sendVideoUrlThumbnailUrlVideoInfoCaptionFormattedCaptionProgressWatcherClosure: ((String, String?, VideoInfo, String?, FormattedBody?, ProgressWatcher?) -> SendAttachmentJoinHandle)? + open var sendVideoUrlThumbnailUrlVideoInfoCaptionFormattedCaptionStoreInCacheProgressWatcherClosure: ((String, String?, VideoInfo, String?, FormattedBody?, Bool, ProgressWatcher?) -> SendAttachmentJoinHandle)? - open override func sendVideo(url: String, thumbnailUrl: String?, videoInfo: VideoInfo, caption: String?, formattedCaption: FormattedBody?, progressWatcher: ProgressWatcher?) -> SendAttachmentJoinHandle { - sendVideoUrlThumbnailUrlVideoInfoCaptionFormattedCaptionProgressWatcherCallsCount += 1 - sendVideoUrlThumbnailUrlVideoInfoCaptionFormattedCaptionProgressWatcherReceivedArguments = (url: url, thumbnailUrl: thumbnailUrl, videoInfo: videoInfo, caption: caption, formattedCaption: formattedCaption, progressWatcher: progressWatcher) + open override func sendVideo(url: String, thumbnailUrl: String?, videoInfo: VideoInfo, caption: String?, formattedCaption: FormattedBody?, storeInCache: Bool, progressWatcher: ProgressWatcher?) -> SendAttachmentJoinHandle { + sendVideoUrlThumbnailUrlVideoInfoCaptionFormattedCaptionStoreInCacheProgressWatcherCallsCount += 1 + sendVideoUrlThumbnailUrlVideoInfoCaptionFormattedCaptionStoreInCacheProgressWatcherReceivedArguments = (url: url, thumbnailUrl: thumbnailUrl, videoInfo: videoInfo, caption: caption, formattedCaption: formattedCaption, storeInCache: storeInCache, progressWatcher: progressWatcher) DispatchQueue.main.async { - self.sendVideoUrlThumbnailUrlVideoInfoCaptionFormattedCaptionProgressWatcherReceivedInvocations.append((url: url, thumbnailUrl: thumbnailUrl, videoInfo: videoInfo, caption: caption, formattedCaption: formattedCaption, progressWatcher: progressWatcher)) + self.sendVideoUrlThumbnailUrlVideoInfoCaptionFormattedCaptionStoreInCacheProgressWatcherReceivedInvocations.append((url: url, thumbnailUrl: thumbnailUrl, videoInfo: videoInfo, caption: caption, formattedCaption: formattedCaption, storeInCache: storeInCache, progressWatcher: progressWatcher)) } - if let sendVideoUrlThumbnailUrlVideoInfoCaptionFormattedCaptionProgressWatcherClosure = sendVideoUrlThumbnailUrlVideoInfoCaptionFormattedCaptionProgressWatcherClosure { - return sendVideoUrlThumbnailUrlVideoInfoCaptionFormattedCaptionProgressWatcherClosure(url, thumbnailUrl, videoInfo, caption, formattedCaption, progressWatcher) + if let sendVideoUrlThumbnailUrlVideoInfoCaptionFormattedCaptionStoreInCacheProgressWatcherClosure = sendVideoUrlThumbnailUrlVideoInfoCaptionFormattedCaptionStoreInCacheProgressWatcherClosure { + return sendVideoUrlThumbnailUrlVideoInfoCaptionFormattedCaptionStoreInCacheProgressWatcherClosure(url, thumbnailUrl, videoInfo, caption, formattedCaption, storeInCache, progressWatcher) } else { - return sendVideoUrlThumbnailUrlVideoInfoCaptionFormattedCaptionProgressWatcherReturnValue + return sendVideoUrlThumbnailUrlVideoInfoCaptionFormattedCaptionStoreInCacheProgressWatcherReturnValue } } //MARK: - sendVoiceMessage - var sendVoiceMessageUrlAudioInfoWaveformCaptionFormattedCaptionProgressWatcherUnderlyingCallsCount = 0 - open var sendVoiceMessageUrlAudioInfoWaveformCaptionFormattedCaptionProgressWatcherCallsCount: Int { + var sendVoiceMessageUrlAudioInfoWaveformCaptionFormattedCaptionStoreInCacheProgressWatcherUnderlyingCallsCount = 0 + open var sendVoiceMessageUrlAudioInfoWaveformCaptionFormattedCaptionStoreInCacheProgressWatcherCallsCount: Int { get { if Thread.isMainThread { - return sendVoiceMessageUrlAudioInfoWaveformCaptionFormattedCaptionProgressWatcherUnderlyingCallsCount + return sendVoiceMessageUrlAudioInfoWaveformCaptionFormattedCaptionStoreInCacheProgressWatcherUnderlyingCallsCount } else { var returnValue: Int? = nil DispatchQueue.main.sync { - returnValue = sendVoiceMessageUrlAudioInfoWaveformCaptionFormattedCaptionProgressWatcherUnderlyingCallsCount + returnValue = sendVoiceMessageUrlAudioInfoWaveformCaptionFormattedCaptionStoreInCacheProgressWatcherUnderlyingCallsCount } return returnValue! @@ -19325,29 +19250,29 @@ open class TimelineSDKMock: MatrixRustSDK.Timeline { } set { if Thread.isMainThread { - sendVoiceMessageUrlAudioInfoWaveformCaptionFormattedCaptionProgressWatcherUnderlyingCallsCount = newValue + sendVoiceMessageUrlAudioInfoWaveformCaptionFormattedCaptionStoreInCacheProgressWatcherUnderlyingCallsCount = newValue } else { DispatchQueue.main.sync { - sendVoiceMessageUrlAudioInfoWaveformCaptionFormattedCaptionProgressWatcherUnderlyingCallsCount = newValue + sendVoiceMessageUrlAudioInfoWaveformCaptionFormattedCaptionStoreInCacheProgressWatcherUnderlyingCallsCount = newValue } } } } - open var sendVoiceMessageUrlAudioInfoWaveformCaptionFormattedCaptionProgressWatcherCalled: Bool { - return sendVoiceMessageUrlAudioInfoWaveformCaptionFormattedCaptionProgressWatcherCallsCount > 0 + open var sendVoiceMessageUrlAudioInfoWaveformCaptionFormattedCaptionStoreInCacheProgressWatcherCalled: Bool { + return sendVoiceMessageUrlAudioInfoWaveformCaptionFormattedCaptionStoreInCacheProgressWatcherCallsCount > 0 } - open var sendVoiceMessageUrlAudioInfoWaveformCaptionFormattedCaptionProgressWatcherReceivedArguments: (url: String, audioInfo: AudioInfo, waveform: [UInt16], caption: String?, formattedCaption: FormattedBody?, progressWatcher: ProgressWatcher?)? - open var sendVoiceMessageUrlAudioInfoWaveformCaptionFormattedCaptionProgressWatcherReceivedInvocations: [(url: String, audioInfo: AudioInfo, waveform: [UInt16], caption: String?, formattedCaption: FormattedBody?, progressWatcher: ProgressWatcher?)] = [] + open var sendVoiceMessageUrlAudioInfoWaveformCaptionFormattedCaptionStoreInCacheProgressWatcherReceivedArguments: (url: String, audioInfo: AudioInfo, waveform: [UInt16], caption: String?, formattedCaption: FormattedBody?, storeInCache: Bool, progressWatcher: ProgressWatcher?)? + open var sendVoiceMessageUrlAudioInfoWaveformCaptionFormattedCaptionStoreInCacheProgressWatcherReceivedInvocations: [(url: String, audioInfo: AudioInfo, waveform: [UInt16], caption: String?, formattedCaption: FormattedBody?, storeInCache: Bool, progressWatcher: ProgressWatcher?)] = [] - var sendVoiceMessageUrlAudioInfoWaveformCaptionFormattedCaptionProgressWatcherUnderlyingReturnValue: SendAttachmentJoinHandle! - open var sendVoiceMessageUrlAudioInfoWaveformCaptionFormattedCaptionProgressWatcherReturnValue: SendAttachmentJoinHandle! { + var sendVoiceMessageUrlAudioInfoWaveformCaptionFormattedCaptionStoreInCacheProgressWatcherUnderlyingReturnValue: SendAttachmentJoinHandle! + open var sendVoiceMessageUrlAudioInfoWaveformCaptionFormattedCaptionStoreInCacheProgressWatcherReturnValue: SendAttachmentJoinHandle! { get { if Thread.isMainThread { - return sendVoiceMessageUrlAudioInfoWaveformCaptionFormattedCaptionProgressWatcherUnderlyingReturnValue + return sendVoiceMessageUrlAudioInfoWaveformCaptionFormattedCaptionStoreInCacheProgressWatcherUnderlyingReturnValue } else { var returnValue: SendAttachmentJoinHandle? = nil DispatchQueue.main.sync { - returnValue = sendVoiceMessageUrlAudioInfoWaveformCaptionFormattedCaptionProgressWatcherUnderlyingReturnValue + returnValue = sendVoiceMessageUrlAudioInfoWaveformCaptionFormattedCaptionStoreInCacheProgressWatcherUnderlyingReturnValue } return returnValue! @@ -19355,26 +19280,26 @@ open class TimelineSDKMock: MatrixRustSDK.Timeline { } set { if Thread.isMainThread { - sendVoiceMessageUrlAudioInfoWaveformCaptionFormattedCaptionProgressWatcherUnderlyingReturnValue = newValue + sendVoiceMessageUrlAudioInfoWaveformCaptionFormattedCaptionStoreInCacheProgressWatcherUnderlyingReturnValue = newValue } else { DispatchQueue.main.sync { - sendVoiceMessageUrlAudioInfoWaveformCaptionFormattedCaptionProgressWatcherUnderlyingReturnValue = newValue + sendVoiceMessageUrlAudioInfoWaveformCaptionFormattedCaptionStoreInCacheProgressWatcherUnderlyingReturnValue = newValue } } } } - open var sendVoiceMessageUrlAudioInfoWaveformCaptionFormattedCaptionProgressWatcherClosure: ((String, AudioInfo, [UInt16], String?, FormattedBody?, ProgressWatcher?) -> SendAttachmentJoinHandle)? + open var sendVoiceMessageUrlAudioInfoWaveformCaptionFormattedCaptionStoreInCacheProgressWatcherClosure: ((String, AudioInfo, [UInt16], String?, FormattedBody?, Bool, ProgressWatcher?) -> SendAttachmentJoinHandle)? - open override func sendVoiceMessage(url: String, audioInfo: AudioInfo, waveform: [UInt16], caption: String?, formattedCaption: FormattedBody?, progressWatcher: ProgressWatcher?) -> SendAttachmentJoinHandle { - sendVoiceMessageUrlAudioInfoWaveformCaptionFormattedCaptionProgressWatcherCallsCount += 1 - sendVoiceMessageUrlAudioInfoWaveformCaptionFormattedCaptionProgressWatcherReceivedArguments = (url: url, audioInfo: audioInfo, waveform: waveform, caption: caption, formattedCaption: formattedCaption, progressWatcher: progressWatcher) + open override func sendVoiceMessage(url: String, audioInfo: AudioInfo, waveform: [UInt16], caption: String?, formattedCaption: FormattedBody?, storeInCache: Bool, progressWatcher: ProgressWatcher?) -> SendAttachmentJoinHandle { + sendVoiceMessageUrlAudioInfoWaveformCaptionFormattedCaptionStoreInCacheProgressWatcherCallsCount += 1 + sendVoiceMessageUrlAudioInfoWaveformCaptionFormattedCaptionStoreInCacheProgressWatcherReceivedArguments = (url: url, audioInfo: audioInfo, waveform: waveform, caption: caption, formattedCaption: formattedCaption, storeInCache: storeInCache, progressWatcher: progressWatcher) DispatchQueue.main.async { - self.sendVoiceMessageUrlAudioInfoWaveformCaptionFormattedCaptionProgressWatcherReceivedInvocations.append((url: url, audioInfo: audioInfo, waveform: waveform, caption: caption, formattedCaption: formattedCaption, progressWatcher: progressWatcher)) + self.sendVoiceMessageUrlAudioInfoWaveformCaptionFormattedCaptionStoreInCacheProgressWatcherReceivedInvocations.append((url: url, audioInfo: audioInfo, waveform: waveform, caption: caption, formattedCaption: formattedCaption, storeInCache: storeInCache, progressWatcher: progressWatcher)) } - if let sendVoiceMessageUrlAudioInfoWaveformCaptionFormattedCaptionProgressWatcherClosure = sendVoiceMessageUrlAudioInfoWaveformCaptionFormattedCaptionProgressWatcherClosure { - return sendVoiceMessageUrlAudioInfoWaveformCaptionFormattedCaptionProgressWatcherClosure(url, audioInfo, waveform, caption, formattedCaption, progressWatcher) + if let sendVoiceMessageUrlAudioInfoWaveformCaptionFormattedCaptionStoreInCacheProgressWatcherClosure = sendVoiceMessageUrlAudioInfoWaveformCaptionFormattedCaptionStoreInCacheProgressWatcherClosure { + return sendVoiceMessageUrlAudioInfoWaveformCaptionFormattedCaptionStoreInCacheProgressWatcherClosure(url, audioInfo, waveform, caption, formattedCaption, storeInCache, progressWatcher) } else { - return sendVoiceMessageUrlAudioInfoWaveformCaptionFormattedCaptionProgressWatcherReturnValue + return sendVoiceMessageUrlAudioInfoWaveformCaptionFormattedCaptionStoreInCacheProgressWatcherReturnValue } } @@ -20947,6 +20872,71 @@ open class UserIdentitySDKMock: MatrixRustSDK.UserIdentity { fileprivate var pointer: UnsafeMutableRawPointer! + //MARK: - isVerified + + var isVerifiedUnderlyingCallsCount = 0 + open var isVerifiedCallsCount: Int { + get { + if Thread.isMainThread { + return isVerifiedUnderlyingCallsCount + } else { + var returnValue: Int? = nil + DispatchQueue.main.sync { + returnValue = isVerifiedUnderlyingCallsCount + } + + return returnValue! + } + } + set { + if Thread.isMainThread { + isVerifiedUnderlyingCallsCount = newValue + } else { + DispatchQueue.main.sync { + isVerifiedUnderlyingCallsCount = newValue + } + } + } + } + open var isVerifiedCalled: Bool { + return isVerifiedCallsCount > 0 + } + + var isVerifiedUnderlyingReturnValue: Bool! + open var isVerifiedReturnValue: Bool! { + get { + if Thread.isMainThread { + return isVerifiedUnderlyingReturnValue + } else { + var returnValue: Bool? = nil + DispatchQueue.main.sync { + returnValue = isVerifiedUnderlyingReturnValue + } + + return returnValue! + } + } + set { + if Thread.isMainThread { + isVerifiedUnderlyingReturnValue = newValue + } else { + DispatchQueue.main.sync { + isVerifiedUnderlyingReturnValue = newValue + } + } + } + } + open var isVerifiedClosure: (() -> Bool)? + + open override func isVerified() -> Bool { + isVerifiedCallsCount += 1 + if let isVerifiedClosure = isVerifiedClosure { + return isVerifiedClosure() + } else { + return isVerifiedReturnValue + } + } + //MARK: - masterKey var masterKeyUnderlyingCallsCount = 0 diff --git a/ElementX/Sources/Services/Client/ClientProxy.swift b/ElementX/Sources/Services/Client/ClientProxy.swift index 59b890ff84..4ad6d49a1c 100644 --- a/ElementX/Sources/Services/Client/ClientProxy.swift +++ b/ElementX/Sources/Services/Client/ClientProxy.swift @@ -931,7 +931,7 @@ class ClientProxy: ClientProxyProtocol { MXLog.info("Pinning current identity for user: \(userID)") do { - guard let userIdentity = try await client.encryption().getUserIdentity(userId: userID) else { + guard let userIdentity = try await client.encryption().userIdentity(userId: userID) else { MXLog.error("Failed retrieving identity for user: \(userID)") return .failure(.failedRetrievingUserIdentity) } diff --git a/ElementX/Sources/Services/Client/ClientProxyProtocol.swift b/ElementX/Sources/Services/Client/ClientProxyProtocol.swift index c9d5b15602..d8eb02b0a9 100644 --- a/ElementX/Sources/Services/Client/ClientProxyProtocol.swift +++ b/ElementX/Sources/Services/Client/ClientProxyProtocol.swift @@ -41,14 +41,6 @@ enum ClientProxyError: Error { enum SlidingSyncConstants { static let defaultTimelineLimit: UInt32 = 20 static let maximumVisibleRangeSize = 30 - static let defaultRequiredState = [ - RequiredState(key: "m.room.name", value: ""), - RequiredState(key: "m.room.topic", value: ""), - RequiredState(key: "m.room.avatar", value: ""), - RequiredState(key: "m.room.canonical_alias", value: ""), - RequiredState(key: "m.room.join_rules", value: ""), - RequiredState(key: "m.room.pinned_events", value: "") - ] } /// This struct represents the configuration that we are using to register the application through Pusher to Sygnal diff --git a/ElementX/Sources/Services/Room/JoinedRoomProxy.swift b/ElementX/Sources/Services/Room/JoinedRoomProxy.swift index 13d3f75921..a887cf6ba1 100644 --- a/ElementX/Sources/Services/Room/JoinedRoomProxy.swift +++ b/ElementX/Sources/Services/Room/JoinedRoomProxy.swift @@ -187,11 +187,8 @@ class JoinedRoomProxy: JoinedRoomProxyProtocol { } subscribedForUpdates = true - let settings = RoomSubscription(requiredState: SlidingSyncConstants.defaultRequiredState, - timelineLimit: SlidingSyncConstants.defaultTimelineLimit, - includeHeroes: false) // We don't need heroes here as they're already included in the `all_rooms` list do { - try roomListService.subscribeToRooms(roomIds: [id], settings: settings) + try roomListService.subscribeToRooms(roomIds: [id]) } catch { MXLog.error("Failed subscribing to room with error: \(error)") } diff --git a/ElementX/Sources/Services/Room/RoomSummary/RoomSummaryProvider.swift b/ElementX/Sources/Services/Room/RoomSummary/RoomSummaryProvider.swift index a40f17a53f..d2c85a12de 100644 --- a/ElementX/Sources/Services/Room/RoomSummary/RoomSummaryProvider.swift +++ b/ElementX/Sources/Services/Room/RoomSummary/RoomSummaryProvider.swift @@ -176,10 +176,7 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol { guard let self else { return } do { - try roomListService.subscribeToRooms(roomIds: roomIDs, - settings: .init(requiredState: SlidingSyncConstants.defaultRequiredState, - timelineLimit: SlidingSyncConstants.defaultTimelineLimit, - includeHeroes: false)) + try roomListService.subscribeToRooms(roomIds: roomIDs) } catch { MXLog.error("Failed subscribing to rooms with error: \(error)") } diff --git a/ElementX/Sources/Services/Timeline/TimelineProxy.swift b/ElementX/Sources/Services/Timeline/TimelineProxy.swift index f2ad0762d4..3551a3d1f2 100644 --- a/ElementX/Sources/Services/Timeline/TimelineProxy.swift +++ b/ElementX/Sources/Services/Timeline/TimelineProxy.swift @@ -227,7 +227,7 @@ final class TimelineProxy: TimelineProxyProtocol { requestHandle: @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result { MXLog.info("Sending audio") - let handle = timeline.sendAudio(url: url.path(percentEncoded: false), audioInfo: audioInfo, caption: nil, formattedCaption: nil, progressWatcher: UploadProgressListener { progress in + let handle = timeline.sendAudio(url: url.path(percentEncoded: false), audioInfo: audioInfo, caption: nil, formattedCaption: nil, storeInCache: false, progressWatcher: UploadProgressListener { progress in progressSubject?.send(progress) }) @@ -250,7 +250,7 @@ final class TimelineProxy: TimelineProxyProtocol { requestHandle: @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result { MXLog.info("Sending file") - let handle = timeline.sendFile(url: url.path(percentEncoded: false), fileInfo: fileInfo, progressWatcher: UploadProgressListener { progress in + let handle = timeline.sendFile(url: url.path(percentEncoded: false), fileInfo: fileInfo, storeInCache: false, progressWatcher: UploadProgressListener { progress in progressSubject?.send(progress) }) @@ -274,7 +274,7 @@ final class TimelineProxy: TimelineProxyProtocol { requestHandle: @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result { MXLog.info("Sending image") - let handle = timeline.sendImage(url: url.path(percentEncoded: false), thumbnailUrl: thumbnailURL.path(percentEncoded: false), imageInfo: imageInfo, caption: nil, formattedCaption: nil, progressWatcher: UploadProgressListener { progress in + let handle = timeline.sendImage(url: url.path(percentEncoded: false), thumbnailUrl: thumbnailURL.path(percentEncoded: false), imageInfo: imageInfo, caption: nil, formattedCaption: nil, storeInCache: false, progressWatcher: UploadProgressListener { progress in progressSubject?.send(progress) }) @@ -316,7 +316,7 @@ final class TimelineProxy: TimelineProxyProtocol { requestHandle: @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result { MXLog.info("Sending video") - let handle = timeline.sendVideo(url: url.path(percentEncoded: false), thumbnailUrl: thumbnailURL.path(percentEncoded: false), videoInfo: videoInfo, caption: nil, formattedCaption: nil, progressWatcher: UploadProgressListener { progress in + let handle = timeline.sendVideo(url: url.path(percentEncoded: false), thumbnailUrl: thumbnailURL.path(percentEncoded: false), videoInfo: videoInfo, caption: nil, formattedCaption: nil, storeInCache: false, progressWatcher: UploadProgressListener { progress in progressSubject?.send(progress) }) @@ -340,7 +340,7 @@ final class TimelineProxy: TimelineProxyProtocol { requestHandle: @MainActor (SendAttachmentJoinHandleProtocol) -> Void) async -> Result { MXLog.info("Sending voice message") - let handle = timeline.sendVoiceMessage(url: url.path(percentEncoded: false), audioInfo: audioInfo, waveform: waveform, caption: nil, formattedCaption: nil, progressWatcher: UploadProgressListener { progress in + let handle = timeline.sendVoiceMessage(url: url.path(percentEncoded: false), audioInfo: audioInfo, waveform: waveform, caption: nil, formattedCaption: nil, storeInCache: false, progressWatcher: UploadProgressListener { progress in progressSubject?.send(progress) }) diff --git a/project.yml b/project.yml index f7fde5a70e..15f455f9f2 100644 --- a/project.yml +++ b/project.yml @@ -60,7 +60,7 @@ packages: # Element/Matrix dependencies MatrixRustSDK: url: https://github.com/element-hq/matrix-rust-components-swift - exactVersion: 1.0.58 + exactVersion: 1.0.60 # path: ../matrix-rust-sdk Compound: url: https://github.com/element-hq/compound-ios From 9d9d9b508a95a0627bbea47400a6476051e407de Mon Sep 17 00:00:00 2001 From: Mauro Romito Date: Wed, 23 Oct 2024 12:58:31 +0200 Subject: [PATCH 15/20] simplified the invite case code --- .../Mocks/RoomSummaryProviderMock.swift | 13 ++------- .../Screens/HomeScreen/HomeScreenModels.swift | 29 ++++++++++--------- .../View/HomeScreenInviteCell.swift | 9 +++--- .../View/HomeScreenKnockedCell.swift | 6 ++-- .../HomeScreen/View/HomeScreenRoomList.swift | 2 +- .../Room/RoomSummary/RoomSummary.swift | 22 +++++++++++--- .../RoomSummary/RoomSummaryProvider.swift | 5 ++-- UnitTests/Sources/HomeScreenRoomTests.swift | 1 - 8 files changed, 44 insertions(+), 43 deletions(-) diff --git a/ElementX/Sources/Mocks/RoomSummaryProviderMock.swift b/ElementX/Sources/Mocks/RoomSummaryProviderMock.swift index cdb8dfe919..ed88e9efe2 100644 --- a/ElementX/Sources/Mocks/RoomSummaryProviderMock.swift +++ b/ElementX/Sources/Mocks/RoomSummaryProviderMock.swift @@ -72,7 +72,6 @@ extension Array where Element == RoomSummary { RoomSummary(roomListItem: RoomListItemSDKMock(), id: "1", joinRequestType: nil, - inviter: nil, name: "Foundation 🔭🪐🌌", isDirect: false, avatarURL: nil, @@ -90,7 +89,6 @@ extension Array where Element == RoomSummary { RoomSummary(roomListItem: RoomListItemSDKMock(), id: "2", joinRequestType: nil, - inviter: nil, name: "Foundation and Empire", isDirect: false, avatarURL: URL.picturesDirectory, @@ -108,7 +106,6 @@ extension Array where Element == RoomSummary { RoomSummary(roomListItem: RoomListItemSDKMock(), id: "3", joinRequestType: nil, - inviter: nil, name: "Second Foundation", isDirect: false, avatarURL: nil, @@ -126,7 +123,6 @@ extension Array where Element == RoomSummary { RoomSummary(roomListItem: RoomListItemSDKMock(), id: "4", joinRequestType: nil, - inviter: nil, name: "Foundation's Edge", isDirect: false, avatarURL: nil, @@ -144,7 +140,6 @@ extension Array where Element == RoomSummary { RoomSummary(roomListItem: RoomListItemSDKMock(), id: "5", joinRequestType: nil, - inviter: nil, name: "Foundation and Earth", isDirect: true, avatarURL: nil, @@ -162,7 +157,6 @@ extension Array where Element == RoomSummary { RoomSummary(roomListItem: RoomListItemSDKMock(), id: "6", joinRequestType: nil, - inviter: nil, name: "Prelude to Foundation", isDirect: true, avatarURL: nil, @@ -180,7 +174,6 @@ extension Array where Element == RoomSummary { RoomSummary(roomListItem: RoomListItemSDKMock(), id: "0", joinRequestType: nil, - inviter: nil, name: "Unknown", isDirect: false, avatarURL: nil, @@ -230,8 +223,7 @@ extension Array where Element == RoomSummary { static let mockInvites: [Element] = [ RoomSummary(roomListItem: RoomListItemSDKMock(), id: "someAwesomeRoomId1", - joinRequestType: nil, - inviter: RoomMemberProxyMock.mockCharlie, + joinRequestType: .invite(inviter: RoomMemberProxyMock.mockCharlie), name: "First room", isDirect: false, avatarURL: URL.picturesDirectory, @@ -248,8 +240,7 @@ extension Array where Element == RoomSummary { isFavourite: false), RoomSummary(roomListItem: RoomListItemSDKMock(), id: "someAwesomeRoomId2", - joinRequestType: nil, - inviter: RoomMemberProxyMock.mockCharlie, + joinRequestType: .invite(inviter: RoomMemberProxyMock.mockCharlie), name: "Second room", isDirect: true, avatarURL: nil, diff --git a/ElementX/Sources/Screens/HomeScreen/HomeScreenModels.swift b/ElementX/Sources/Screens/HomeScreen/HomeScreenModels.swift index 134660cdb0..d253a14be5 100644 --- a/ElementX/Sources/Screens/HomeScreen/HomeScreenModels.swift +++ b/ElementX/Sources/Screens/HomeScreen/HomeScreenModels.swift @@ -127,11 +127,11 @@ struct HomeScreenViewStateBindings { } struct HomeScreenRoom: Identifiable, Equatable { - enum RoomType { + enum RoomType: Equatable { case placeholder case room - case invite - case knocked + case invite(inviterDetails: RoomInviterDetails?) + case knock } static let placeholderLastMessage = AttributedString("Hidden last message") @@ -144,6 +144,13 @@ struct HomeScreenRoom: Identifiable, Equatable { let type: RoomType + var inviter: RoomInviterDetails? { + if case .invite(let inviter) = type { + return inviter + } + return nil + } + let badges: Badges struct Badges: Equatable { let isDotShown: Bool @@ -165,9 +172,7 @@ struct HomeScreenRoom: Identifiable, Equatable { let lastMessage: AttributedString? let avatar: RoomAvatar - - let inviter: RoomInviterDetails? - + let canonicalAlias: String? static func placeholder() -> HomeScreenRoom { @@ -182,7 +187,6 @@ struct HomeScreenRoom: Identifiable, Equatable { timestamp: "Now", lastMessage: placeholderLastMessage, avatar: .room(id: "", name: "", avatarURL: nil), - inviter: nil, canonicalAlias: nil) } } @@ -193,17 +197,15 @@ extension HomeScreenRoom { let hasUnreadMessages = hideUnreadMessagesBadge ? false : summary.hasUnreadMessages - let isDotShown = hasUnreadMessages || summary.hasUnreadMentions || summary.hasUnreadNotifications || summary.isMarkedUnread || summary.joinRequestType == .knocked + let isDotShown = hasUnreadMessages || summary.hasUnreadMentions || summary.hasUnreadNotifications || summary.isMarkedUnread || summary.joinRequestType?.isKnock == true let isMentionShown = summary.hasUnreadMentions && !summary.isMuted let isMuteShown = summary.isMuted let isCallShown = summary.hasOngoingCall - let isHighlighted = summary.isMarkedUnread || (!summary.isMuted && (summary.hasUnreadNotifications || summary.hasUnreadMentions)) || summary.joinRequestType == .knocked - - let inviter = summary.inviter.map(RoomInviterDetails.init) + let isHighlighted = summary.isMarkedUnread || (!summary.isMuted && (summary.hasUnreadNotifications || summary.hasUnreadMentions)) || summary.joinRequestType?.isKnock == true let type: HomeScreenRoom.RoomType = switch summary.joinRequestType { - case .invite: .invite - case .knocked: .knocked + case .invite(let inviter): .invite(inviterDetails: inviter.map(RoomInviterDetails.init)) + case .knock: .knock case .none: .room } @@ -221,7 +223,6 @@ extension HomeScreenRoom { timestamp: summary.lastMessageFormattedTimestamp, lastMessage: summary.lastMessage, avatar: summary.avatar, - inviter: inviter, canonicalAlias: summary.canonicalAlias) } } diff --git a/ElementX/Sources/Screens/HomeScreen/View/HomeScreenInviteCell.swift b/ElementX/Sources/Screens/HomeScreen/View/HomeScreenInviteCell.swift index dd48ffdc9f..2abc3a7701 100644 --- a/ElementX/Sources/Screens/HomeScreen/View/HomeScreenInviteCell.swift +++ b/ElementX/Sources/Screens/HomeScreen/View/HomeScreenInviteCell.swift @@ -69,7 +69,8 @@ struct HomeScreenInviteCell: View { @ViewBuilder private var inviterView: some View { - if let inviter = room.inviter, !room.isDirect { + if let inviter = room.inviter, + !room.isDirect { RoomInviterLabel(inviter: inviter, mediaProvider: context.mediaProvider) .font(.compound.bodyMD) .foregroundStyle(.compound.textPlaceholder) @@ -177,8 +178,7 @@ private extension HomeScreenRoom { let summary = RoomSummary(roomListItem: RoomListItemSDKMock(), id: "@someone:somewhere.com", - joinRequestType: nil, - inviter: inviter, + joinRequestType: .invite(inviter: inviter), name: "Some Guy", isDirect: true, avatarURL: nil, @@ -205,8 +205,7 @@ private extension HomeScreenRoom { let summary = RoomSummary(roomListItem: RoomListItemSDKMock(), id: "@someone:somewhere.com", - joinRequestType: nil, - inviter: inviter, + joinRequestType: .invite(inviter: inviter), name: "Awesome Room", isDirect: false, avatarURL: avatarURL, diff --git a/ElementX/Sources/Screens/HomeScreen/View/HomeScreenKnockedCell.swift b/ElementX/Sources/Screens/HomeScreen/View/HomeScreenKnockedCell.swift index c34c15daf0..8da9888145 100644 --- a/ElementX/Sources/Screens/HomeScreen/View/HomeScreenKnockedCell.swift +++ b/ElementX/Sources/Screens/HomeScreen/View/HomeScreenKnockedCell.swift @@ -152,8 +152,7 @@ private extension HomeScreenRoom { let summary = RoomSummary(roomListItem: RoomListItemSDKMock(), id: "@someone:somewhere.com", - joinRequestType: nil, - inviter: inviter, + joinRequestType: .invite(inviter: inviter), name: "Some Guy", isDirect: true, avatarURL: nil, @@ -180,8 +179,7 @@ private extension HomeScreenRoom { let summary = RoomSummary(roomListItem: RoomListItemSDKMock(), id: "@someone:somewhere.com", - joinRequestType: nil, - inviter: inviter, + joinRequestType: .invite(inviter: inviter), name: "Awesome Room", isDirect: false, avatarURL: avatarURL, diff --git a/ElementX/Sources/Screens/HomeScreen/View/HomeScreenRoomList.swift b/ElementX/Sources/Screens/HomeScreen/View/HomeScreenRoomList.swift index 066644a4b3..fb224413a2 100644 --- a/ElementX/Sources/Screens/HomeScreen/View/HomeScreenRoomList.swift +++ b/ElementX/Sources/Screens/HomeScreen/View/HomeScreenRoomList.swift @@ -32,7 +32,7 @@ struct HomeScreenRoomList: View { .redacted(reason: .placeholder) case .invite: HomeScreenInviteCell(room: room, context: context) - case .knocked: + case .knock: HomeScreenKnockedCell(room: room, context: context) case .room: let isSelected = context.viewState.selectedRoomID == room.id diff --git a/ElementX/Sources/Services/Room/RoomSummary/RoomSummary.swift b/ElementX/Sources/Services/Room/RoomSummary/RoomSummary.swift index ff2045209b..429cba58ad 100644 --- a/ElementX/Sources/Services/Room/RoomSummary/RoomSummary.swift +++ b/ElementX/Sources/Services/Room/RoomSummary/RoomSummary.swift @@ -10,8 +10,24 @@ import MatrixRustSDK struct RoomSummary { enum JoinRequestType { - case invite - case knocked + case invite(inviter: RoomMemberProxyProtocol?) + case knock + + var isInvite: Bool { + if case .invite = self { + return true + } else { + return false + } + } + + var isKnock: Bool { + if case .knock = self { + return true + } else { + return false + } + } } let roomListItem: RoomListItem @@ -19,7 +35,6 @@ struct RoomSummary { let id: String let joinRequestType: JoinRequestType? - let inviter: RoomMemberProxyProtocol? let name: String let isDirect: Bool @@ -72,7 +87,6 @@ extension RoomSummary { unreadNotificationsCount = hasUnreadNotifications ? 1 : 0 notificationMode = settingsMode canonicalAlias = nil - inviter = nil hasOngoingCall = false joinRequestType = nil diff --git a/ElementX/Sources/Services/Room/RoomSummary/RoomSummaryProvider.swift b/ElementX/Sources/Services/Room/RoomSummary/RoomSummaryProvider.swift index d2c85a12de..4622c5661e 100644 --- a/ElementX/Sources/Services/Room/RoomSummary/RoomSummaryProvider.swift +++ b/ElementX/Sources/Services/Room/RoomSummary/RoomSummaryProvider.swift @@ -256,15 +256,14 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol { let notificationMode = roomInfo.cachedUserDefinedNotificationMode.flatMap { RoomNotificationModeProxy.from(roomNotificationMode: $0) } let joinRequestType: RoomSummary.JoinRequestType? = switch roomInfo.membership { - case .invited: .invite - case .knocked: .knocked + case .invited: .invite(inviter: inviterProxy) + case .knocked: .knock default: nil } return RoomSummary(roomListItem: roomListItem, id: roomInfo.id, joinRequestType: joinRequestType, - inviter: inviterProxy, name: roomInfo.displayName ?? roomInfo.id, isDirect: roomInfo.isDirect, avatarURL: roomInfo.avatarUrl.flatMap(URL.init(string:)), diff --git a/UnitTests/Sources/HomeScreenRoomTests.swift b/UnitTests/Sources/HomeScreenRoomTests.swift index f0615ccf47..1cbe828d23 100644 --- a/UnitTests/Sources/HomeScreenRoomTests.swift +++ b/UnitTests/Sources/HomeScreenRoomTests.swift @@ -24,7 +24,6 @@ class HomeScreenRoomTests: XCTestCase { roomSummary = RoomSummary(roomListItem: .init(noPointer: .init()), id: "Test room", joinRequestType: nil, - inviter: nil, name: "Test room", isDirect: false, avatarURL: nil, From 18e18f544e25814f660541bfce000bf10bc40bb3 Mon Sep 17 00:00:00 2001 From: Mauro Romito Date: Wed, 23 Oct 2024 13:40:26 +0200 Subject: [PATCH 16/20] pr comments --- ElementX.xcodeproj/project.pbxproj | 44 ++++++++----------- .../en.lproj/Localizable.strings | 10 ++++- ElementX/Sources/Generated/Strings.swift | 18 ++++++-- .../SwiftUI/Views}/RoomHeaderView.swift | 0 .../View/HomeScreenKnockedCell.swift | 2 +- 5 files changed, 42 insertions(+), 32 deletions(-) rename ElementX/Sources/{Screens/RoomScreen/View => Other/SwiftUI/Views}/RoomHeaderView.swift (100%) diff --git a/ElementX.xcodeproj/project.pbxproj b/ElementX.xcodeproj/project.pbxproj index b02273a473..892961dc93 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 */ @@ -1219,13 +1219,13 @@ 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 = ""; }; 045253F9967A535EE5B16691 /* Label.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Label.swift; sourceTree = ""; }; 046C0D3F53B0B5EF0A1F5BEA /* RoomSummaryTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomSummaryTests.swift; sourceTree = ""; }; - 048A21188AB19349D026BECD /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; path = PrivacyInfo.xcprivacy; sourceTree = ""; }; + 048A21188AB19349D026BECD /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = ""; }; 04BB8DDE245ED86C489BA983 /* AccessibilityIdentifiers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccessibilityIdentifiers.swift; sourceTree = ""; }; 04DF593C3F7AF4B2FBAEB05D /* FileManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileManager.swift; sourceTree = ""; }; 0516C69708D5CBDE1A8E77EC /* RoomDirectorySearchProxyProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomDirectorySearchProxyProtocol.swift; sourceTree = ""; }; @@ -1291,7 +1291,7 @@ 127A57D053CE8C87B5EFB089 /* Consumable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Consumable.swift; sourceTree = ""; }; 127C8472672A5BA09EF1ACF8 /* CurrentValuePublisher.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CurrentValuePublisher.swift; sourceTree = ""; }; 128501375217576AF0FE3E92 /* RoomAttachmentPicker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomAttachmentPicker.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 = ""; }; 136F80A613B55BDD071DCEA5 /* JoinRoomScreenModels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JoinRoomScreenModels.swift; sourceTree = ""; }; 13802897C7AFA360EA74C0B0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = en; path = en.lproj/Localizable.stringsdict; sourceTree = ""; }; @@ -1380,7 +1380,7 @@ 25F7FE40EF7490A7E09D7BE6 /* NotificationItemProxy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationItemProxy.swift; sourceTree = ""; }; 25F8664F1FB95AF3C4202478 /* PollFormScreenCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PollFormScreenCoordinator.swift; sourceTree = ""; }; 260004737C573A56FA01E86E /* Encodable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Encodable.swift; sourceTree = ""; }; - 267BB1D5B08A9511F894CB57 /* PreviewTests.xctestplan */ = {isa = PBXFileReference; path = PreviewTests.xctestplan; sourceTree = ""; }; + 267BB1D5B08A9511F894CB57 /* PreviewTests.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = PreviewTests.xctestplan; sourceTree = ""; }; 26B0A96B8FE4849227945067 /* VoiceMessageRecorder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VoiceMessageRecorder.swift; sourceTree = ""; }; 26EAAB54C6CE91D64B69A9F8 /* AppLockServiceProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppLockServiceProtocol.swift; sourceTree = ""; }; 2721D7B051F0159AA919DA05 /* RoomChangePermissionsScreenViewModelProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomChangePermissionsScreenViewModelProtocol.swift; sourceTree = ""; }; @@ -1451,7 +1451,7 @@ 3558A15CFB934F9229301527 /* RestorationToken.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RestorationToken.swift; sourceTree = ""; }; 35AFCF4C05DEED04E3DB1A16 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/Localizable.strings; sourceTree = ""; }; 35FA991289149D31F4286747 /* UserPreference.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserPreference.swift; sourceTree = ""; }; - 36DA824791172B9821EACBED /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; path = PrivacyInfo.xcprivacy; sourceTree = ""; }; + 36DA824791172B9821EACBED /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = ""; }; 36FD673E24FBFCFDF398716A /* RoomMemberProxyMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomMemberProxyMock.swift; sourceTree = ""; }; 376D941BF8BB294389C0DE24 /* MapTilerURLBuildersTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapTilerURLBuildersTests.swift; sourceTree = ""; }; 37A243E04B58DC6E41FDCD82 /* EmojiItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmojiItem.swift; sourceTree = ""; }; @@ -1556,7 +1556,7 @@ 4B41FABA2B0AEF4389986495 /* LoginMode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginMode.swift; sourceTree = ""; }; 4BD371B60E07A5324B9507EF /* AnalyticsSettingsScreenCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnalyticsSettingsScreenCoordinator.swift; sourceTree = ""; }; 4C8D988E82A8DFA13BE46F7C /* pl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = pl; path = pl.lproj/Localizable.stringsdict; sourceTree = ""; }; - 4CD6AC7546E8D7E5C73CEA48 /* ElementX.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = ElementX.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 4CD6AC7546E8D7E5C73CEA48 /* ElementX.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ElementX.app; sourceTree = BUILT_PRODUCTS_DIR; }; 4CDDDDD9FE1A699D23A5E096 /* LoginScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginScreen.swift; sourceTree = ""; }; 4D3A7375AB22721C436EB056 /* ComposerToolbarModels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ComposerToolbarModels.swift; sourceTree = ""; }; 4E2245243369B99216C7D84E /* ImageCache.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageCache.swift; sourceTree = ""; }; @@ -1824,7 +1824,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 = ""; }; 8DA1E8F287680C8ED25EDBAC /* NetworkMonitorMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkMonitorMock.swift; sourceTree = ""; }; - 8E088F2A1B9EC529D3221931 /* UITests.xctestplan */ = {isa = PBXFileReference; path = UITests.xctestplan; sourceTree = ""; }; + 8E088F2A1B9EC529D3221931 /* UITests.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = UITests.xctestplan; sourceTree = ""; }; 8E1584F8BCF407BB94F48F04 /* EncryptionResetPasswordScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EncryptionResetPasswordScreen.swift; sourceTree = ""; }; 8EAF4A49F3ACD8BB8B0D2371 /* ClientSDKMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClientSDKMock.swift; sourceTree = ""; }; 8F21ED7205048668BEB44A38 /* AppActivityView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppActivityView.swift; sourceTree = ""; }; @@ -2002,7 +2002,7 @@ B50F03079F6B5EF9CA005F14 /* TimelineProxyProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimelineProxyProtocol.swift; sourceTree = ""; }; B53AC78E49A297AC1D72A7CF /* AppMediator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppMediator.swift; sourceTree = ""; }; B590BD4507D4F0A377FDE01A /* LoadableAvatarImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoadableAvatarImage.swift; sourceTree = ""; }; - B61C339A2FDDBD067FF6635C /* ConfettiScene.scn */ = {isa = PBXFileReference; path = ConfettiScene.scn; sourceTree = ""; }; + B61C339A2FDDBD067FF6635C /* ConfettiScene.scn */ = {isa = PBXFileReference; lastKnownFileType = file.bplist; path = ConfettiScene.scn; sourceTree = ""; }; B63B69F9A2BC74DD40DC75C8 /* AdvancedSettingsScreenViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdvancedSettingsScreenViewModel.swift; sourceTree = ""; }; B6404166CBF5CC88673FF9E2 /* RoomDetails.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomDetails.swift; sourceTree = ""; }; B655A536341D2695158C6664 /* AuthenticationClientBuilderFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthenticationClientBuilderFactory.swift; sourceTree = ""; }; @@ -2117,7 +2117,7 @@ CDB3227C7A74B734924942E9 /* RoomSummaryProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomSummaryProvider.swift; sourceTree = ""; }; CDE3F3911FF7CC639BDE5844 /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/Localizable.strings; sourceTree = ""; }; CEE20623EB4A9B88FB29F2BA /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/SAS.strings; sourceTree = ""; }; - CEE41494C837AA403A06A5D9 /* UnitTests.xctestplan */ = {isa = PBXFileReference; path = UnitTests.xctestplan; sourceTree = ""; }; + CEE41494C837AA403A06A5D9 /* UnitTests.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = UnitTests.xctestplan; sourceTree = ""; }; D071F86CD47582B9196C9D16 /* UserDiscoverySection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserDiscoverySection.swift; sourceTree = ""; }; D086854995173E897F993C26 /* AdvancedSettingsScreenViewModelProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdvancedSettingsScreenViewModelProtocol.swift; sourceTree = ""; }; D09A267106B9585D3D0CFC0D /* ClientError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClientError.swift; sourceTree = ""; }; @@ -2249,7 +2249,7 @@ ED0CBEAB5F796BEFBAF7BB6A /* VideoRoomTimelineView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VideoRoomTimelineView.swift; sourceTree = ""; }; ED1D792EB82506A19A72C8DE /* RoomTimelineItemProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomTimelineItemProtocol.swift; sourceTree = ""; }; ED33988DA4FD4FC666800106 /* SessionVerificationScreenViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SessionVerificationScreenViewModel.swift; sourceTree = ""; }; - ED482057AE39D5C6D9C5F3D8 /* message.caf */ = {isa = PBXFileReference; path = message.caf; sourceTree = ""; }; + ED482057AE39D5C6D9C5F3D8 /* message.caf */ = {isa = PBXFileReference; lastKnownFileType = file; path = message.caf; sourceTree = ""; }; ED49073BB1C1FC649DAC2CCD /* LocationRoomTimelineView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocationRoomTimelineView.swift; sourceTree = ""; }; ED60E4D2CD678E1EBF16F77A /* BlockedUsersScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BlockedUsersScreen.swift; sourceTree = ""; }; EE378083653EF0C9B5E9D580 /* EmoteRoomTimelineItemContent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmoteRoomTimelineItemContent.swift; sourceTree = ""; }; @@ -2271,7 +2271,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 = ""; }; F2E4EF80DFB8FE7C4469B15D /* RoomDirectorySearchScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomDirectorySearchScreen.swift; 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 = ""; }; @@ -2289,7 +2289,7 @@ F5D8FEB1FED10E995CB002F7 /* TimelineBubbleLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimelineBubbleLayout.swift; sourceTree = ""; }; F5E23D8EE6CBACF32F1EC874 /* MediaPlayerProviderProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MediaPlayerProviderProtocol.swift; sourceTree = ""; }; F64A8582F65567AC38C2976A /* PollFormScreenViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PollFormScreenViewModel.swift; sourceTree = ""; }; - F6B676B4866F5B383DE819B2 /* test_apple_image.heic */ = {isa = PBXFileReference; path = test_apple_image.heic; sourceTree = ""; }; + F6B676B4866F5B383DE819B2 /* test_apple_image.heic */ = {isa = PBXFileReference; lastKnownFileType = file; path = test_apple_image.heic; sourceTree = ""; }; F72EFC8C634469F9262659C7 /* NSItemProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NSItemProvider.swift; sourceTree = ""; }; F733F135E6D67BBBEB76CC30 /* AppLockUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppLockUITests.swift; sourceTree = ""; }; F74532E01B317C56C1BE8FA8 /* RoomTimelineProviderMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomTimelineProviderMock.swift; sourceTree = ""; }; @@ -2974,6 +2974,7 @@ DE7C80EF77AD102053D3646E /* RoundedLabelItem.swift */, AEB5FF7A09B79B0C6B528F7C /* SFNumberedListView.swift */, E10DA51DBC8C7E1460DBCCBD /* UserProfileListRow.swift */, + 422724361B6555364C43281E /* RoomHeaderView.swift */, ); path = Views; sourceTree = ""; @@ -4042,7 +4043,6 @@ 79023E5904B155E8E2B8B502 /* View */ = { isa = PBXGroup; children = ( - 422724361B6555364C43281E /* RoomHeaderView.swift */, 5221DFDF809142A2D6AC82B9 /* RoomScreen.swift */, 4137900E28201C314C835C11 /* RoomScreenFooterView.swift */, 4552D3466B1453F287223ADA /* SwipeRightAction.swift */, @@ -7301,9 +7301,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; @@ -7352,9 +7350,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)"; @@ -7380,9 +7376,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)"; @@ -7627,9 +7621,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/Resources/Localizations/en.lproj/Localizable.strings b/ElementX/Resources/Localizations/en.lproj/Localizable.strings index 26c7bf300c..53624f7889 100644 --- a/ElementX/Resources/Localizations/en.lproj/Localizable.strings +++ b/ElementX/Resources/Localizations/en.lproj/Localizable.strings @@ -241,6 +241,8 @@ "common.pinned" = "Pinned"; "common.send_to" = "Send to"; "common.you" = "You"; +"common_unable_to_decrypt_insecure_device" = "Encrypted by an insecure device"; +"common_unable_to_decrypt_verification_violation" = "Sender's verified identity has changed"; "confirm_recovery_key_banner_message" = "Your chat backup is currently out of sync. You need to enter your recovery key to maintain access to your chat backup."; "confirm_recovery_key_banner_title" = "Enter your recovery key"; "crash_detection_dialog_content" = "%1$@ crashed the last time it was used. Would you like to share a crash report with us?"; @@ -352,7 +354,6 @@ "screen_join_room_knock_message_description" = "Message (optional)"; "screen_join_room_knock_sent_description" = "You will receive an invite to join the room if your request is accepted."; "screen_join_room_knock_sent_title" = "Request to join sent"; -"screen_knocked_knock_sent" = "Request to join sent"; "screen_pinned_timeline_empty_state_description" = "Press on a message and choose “%1$@” to include here."; "screen_pinned_timeline_empty_state_headline" = "Pin important messages so that they can be easily discovered"; "screen_reset_encryption_password_error" = "An unknown error happened. Please check your account password is correct and try again."; @@ -370,6 +371,7 @@ "screen_room_pinned_banner_loading_description" = "Loading message…"; "screen_room_pinned_banner_view_all_button_title" = "View All"; "screen_room_details_pinned_events_row_title" = "Pinned messages"; +"screen_roomlist_knock_event_sent_description" = "Request to join sent"; "screen_timeline_item_menu_send_failure_changed_identity" = "Message not sent because %1$@’s verified identity has changed."; "screen_timeline_item_menu_send_failure_unsigned_device" = "Message not sent because %1$@ has not verified all devices."; "screen_timeline_item_menu_send_failure_you_unsigned_device" = "Message not sent because you have not verified one or more of your devices."; @@ -821,12 +823,16 @@ "screen_session_verification_open_existing_session_title" = "Open an existing session"; "screen_session_verification_positive_button_canceled" = "Retry verification"; "screen_session_verification_positive_button_initial" = "I am ready"; -"screen_session_verification_positive_button_verifying_ongoing" = "Waiting to match"; +"screen_session_verification_positive_button_verifying_ongoing" = "Waiting to match…"; "screen_session_verification_ready_subtitle" = "Compare a unique set of emojis."; "screen_session_verification_request_accepted_subtitle" = "Compare the unique emoji, ensuring they appear in the same order."; "screen_session_verification_request_details_timestamp" = "Signed in"; +"screen_session_verification_request_failure_subtitle" = "Either the request timed out, the request was denied, or there was a verification mismatch."; +"screen_session_verification_request_failure_title" = "Verification failed"; "screen_session_verification_request_footer" = "Only continue if you initiated this verification."; "screen_session_verification_request_subtitle" = "Verify the other device to keep your message history secure."; +"screen_session_verification_request_success_subtitle" = "Now you can read or send messages securely on your other device."; +"screen_session_verification_request_success_title" = "Device verified"; "screen_session_verification_request_title" = "Verification requested"; "screen_session_verification_they_dont_match" = "They don’t match"; "screen_session_verification_they_match" = "They match"; diff --git a/ElementX/Sources/Generated/Strings.swift b/ElementX/Sources/Generated/Strings.swift index be057bfd0f..8c01f58c08 100644 --- a/ElementX/Sources/Generated/Strings.swift +++ b/ElementX/Sources/Generated/Strings.swift @@ -488,8 +488,12 @@ internal enum L10n { internal static var commonTouchIdIos: String { return L10n.tr("Localizable", "common_touch_id_ios") } /// Unable to decrypt internal static var commonUnableToDecrypt: String { return L10n.tr("Localizable", "common_unable_to_decrypt") } + /// Encrypted by an insecure device + internal static var commonUnableToDecryptInsecureDevice: String { return L10n.tr("Localizable", "common_unable_to_decrypt_insecure_device") } /// You don't have access to this message internal static var commonUnableToDecryptNoAccess: String { return L10n.tr("Localizable", "common_unable_to_decrypt_no_access") } + /// Sender's verified identity has changed + internal static var commonUnableToDecryptVerificationViolation: String { return L10n.tr("Localizable", "common_unable_to_decrypt_verification_violation") } /// Invites couldn't be sent to one or more users. internal static var commonUnableToInviteMessage: String { return L10n.tr("Localizable", "common_unable_to_invite_message") } /// Unable to send invite(s) @@ -1243,8 +1247,6 @@ internal enum L10n { } /// Are you sure you want to turn off backup? internal static var screenKeyBackupDisableTitle: String { return L10n.tr("Localizable", "screen_key_backup_disable_title") } - /// Request to join sent - internal static var screenKnockedKnockSent: String { return L10n.tr("Localizable", "screen_knocked_knock_sent") } /// This account has been deactivated. internal static var screenLoginErrorDeactivatedAccount: String { return L10n.tr("Localizable", "screen_login_error_deactivated_account") } /// Incorrect username and/or password @@ -1963,6 +1965,8 @@ internal enum L10n { /// Congrats! /// You don’t have any unread messages! internal static var screenRoomlistFilterUnreadsEmptyStateTitle: String { return L10n.tr("Localizable", "screen_roomlist_filter_unreads_empty_state_title") } + /// Request to join sent + internal static var screenRoomlistKnockEventSentDescription: String { return L10n.tr("Localizable", "screen_roomlist_knock_event_sent_description") } /// Chats internal static var screenRoomlistMainSpaceTitle: String { return L10n.tr("Localizable", "screen_roomlist_main_space_title") } /// Mark as read @@ -2011,7 +2015,7 @@ internal enum L10n { internal static var screenSessionVerificationPositiveButtonCanceled: String { return L10n.tr("Localizable", "screen_session_verification_positive_button_canceled") } /// I am ready internal static var screenSessionVerificationPositiveButtonInitial: String { return L10n.tr("Localizable", "screen_session_verification_positive_button_initial") } - /// Waiting to match + /// Waiting to match… internal static var screenSessionVerificationPositiveButtonVerifyingOngoing: String { return L10n.tr("Localizable", "screen_session_verification_positive_button_verifying_ongoing") } /// Compare a unique set of emojis. internal static var screenSessionVerificationReadySubtitle: String { return L10n.tr("Localizable", "screen_session_verification_ready_subtitle") } @@ -2019,10 +2023,18 @@ internal enum L10n { internal static var screenSessionVerificationRequestAcceptedSubtitle: String { return L10n.tr("Localizable", "screen_session_verification_request_accepted_subtitle") } /// Signed in internal static var screenSessionVerificationRequestDetailsTimestamp: String { return L10n.tr("Localizable", "screen_session_verification_request_details_timestamp") } + /// Either the request timed out, the request was denied, or there was a verification mismatch. + internal static var screenSessionVerificationRequestFailureSubtitle: String { return L10n.tr("Localizable", "screen_session_verification_request_failure_subtitle") } + /// Verification failed + internal static var screenSessionVerificationRequestFailureTitle: String { return L10n.tr("Localizable", "screen_session_verification_request_failure_title") } /// Only continue if you initiated this verification. internal static var screenSessionVerificationRequestFooter: String { return L10n.tr("Localizable", "screen_session_verification_request_footer") } /// Verify the other device to keep your message history secure. internal static var screenSessionVerificationRequestSubtitle: String { return L10n.tr("Localizable", "screen_session_verification_request_subtitle") } + /// Now you can read or send messages securely on your other device. + internal static var screenSessionVerificationRequestSuccessSubtitle: String { return L10n.tr("Localizable", "screen_session_verification_request_success_subtitle") } + /// Device verified + internal static var screenSessionVerificationRequestSuccessTitle: String { return L10n.tr("Localizable", "screen_session_verification_request_success_title") } /// Verification requested internal static var screenSessionVerificationRequestTitle: String { return L10n.tr("Localizable", "screen_session_verification_request_title") } /// They don’t match diff --git a/ElementX/Sources/Screens/RoomScreen/View/RoomHeaderView.swift b/ElementX/Sources/Other/SwiftUI/Views/RoomHeaderView.swift similarity index 100% rename from ElementX/Sources/Screens/RoomScreen/View/RoomHeaderView.swift rename to ElementX/Sources/Other/SwiftUI/Views/RoomHeaderView.swift diff --git a/ElementX/Sources/Screens/HomeScreen/View/HomeScreenKnockedCell.swift b/ElementX/Sources/Screens/HomeScreen/View/HomeScreenKnockedCell.swift index 8da9888145..a1cdf9bfb4 100644 --- a/ElementX/Sources/Screens/HomeScreen/View/HomeScreenKnockedCell.swift +++ b/ElementX/Sources/Screens/HomeScreen/View/HomeScreenKnockedCell.swift @@ -54,7 +54,7 @@ struct HomeScreenKnockedCell: View { badge } - Text(L10n.screenKnockedKnockSent) + Text(L10n.screenRoomlistKnockEventSentDescription) .font(.compound.bodyMD) .foregroundStyle(.compound.textPlaceholder) .padding(.top, room.canonicalAlias == nil ? 0 : 4) From 3677dc7afd16394a009abbf5078b8f568cf3b941 Mon Sep 17 00:00:00 2001 From: Mauro Romito Date: Wed, 23 Oct 2024 13:52:18 +0200 Subject: [PATCH 17/20] updated previews --- ElementX.xcodeproj/project.pbxproj | 58 +++++++++++-------- ...test_joinRoomScreen-iPad-en-GB.Knocked.png | 4 +- ...est_joinRoomScreen-iPad-pseudo.Knocked.png | 4 +- ...joinRoomScreen-iPhone-16-en-GB.Knocked.png | 4 +- ...oinRoomScreen-iPhone-16-pseudo.Knocked.png | 4 +- 5 files changed, 41 insertions(+), 33 deletions(-) diff --git a/ElementX.xcodeproj/project.pbxproj b/ElementX.xcodeproj/project.pbxproj index 892961dc93..fc904db96a 100644 --- a/ElementX.xcodeproj/project.pbxproj +++ b/ElementX.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 56; + objectVersion = 54; objects = { /* Begin PBXAggregateTarget section */ @@ -34,7 +34,6 @@ 03CDCA6243F89B194E3FAD17 /* EncryptionAuthenticity.swift in Sources */ = {isa = PBXBuildFile; fileRef = 955336CBD5ED73C792D1F580 /* EncryptionAuthenticity.swift */; }; 0437765FF480249486893CC7 /* ScreenTrackerViewModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 196004E7695FBA292A7944AF /* ScreenTrackerViewModifier.swift */; }; 044DD8F80231BC30570F7965 /* UserDiscoveryService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65AAD845E53B0C8B5E0812C2 /* UserDiscoveryService.swift */; }; - 04A16B45228F7678A027C079 /* RoomHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 422724361B6555364C43281E /* RoomHeaderView.swift */; }; 04F17DE71A50206336749BAC /* UserPreferenceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = BA241DEEF7C8A7181C0AEDC9 /* UserPreferenceTests.swift */; }; 053B8BD2496207838878C6C9 /* PinnedItemsBannerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60C9BAE9F9436B14E4E22E8F /* PinnedItemsBannerView.swift */; }; 059173B3C77056C406906B6D /* target.yml in Resources */ = {isa = PBXBuildFile; fileRef = D4DA544B2520BFA65D6DB4BB /* target.yml */; }; @@ -718,6 +717,7 @@ 9BD3A773186291560DF92B62 /* RoomTimelineProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 66F2402D738694F98729A441 /* RoomTimelineProvider.swift */; }; 9C4EC28A921486B1775D7F8C /* IdentityConfirmedScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 307702DD66E7DDCDD9214784 /* IdentityConfirmedScreen.swift */; }; 9C55746D8F6A3E35CFCF4A7A /* AuthenticationStartLogo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 598F01EBD0C4CC550C644418 /* AuthenticationStartLogo.swift */; }; + 9C63171267E22FEB288EC860 /* RoomHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1627F2D56477BD331F6D732C /* RoomHeaderView.swift */; }; 9CBB04365408F9D6F46BA3A7 /* PinnedEventsTimelineFlowCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = A54AAF72E821B4084B7E4298 /* PinnedEventsTimelineFlowCoordinator.swift */; }; 9D2E03DB175A6AB14589076D /* AnalyticsEvents in Frameworks */ = {isa = PBXBuildFile; productRef = 2A3F7BCCB18C15B30CCA39A9 /* AnalyticsEvents */; }; 9D79B94493FB32249F7E472F /* PlaceholderAvatarImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = C705E605EF57C19DBE86FFA1 /* PlaceholderAvatarImage.swift */; }; @@ -964,7 +964,6 @@ D43F0503EF2CBC55272538FE /* SDKGeneratedMocks.swift in Sources */ = {isa = PBXBuildFile; fileRef = C2F079B5DBD0D85FEA687AAE /* SDKGeneratedMocks.swift */; }; D46C33F8B61B55F0C8C2D15F /* LocationRoomTimelineItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B2AC540DE619B36832A5DB5 /* LocationRoomTimelineItem.swift */; }; D4CB979EB4FE26AAD9F9A72B /* UserProfileScreenModels.swift in Sources */ = {isa = PBXBuildFile; fileRef = 604A69C081B935D6A38DE6D8 /* UserProfileScreenModels.swift */; }; - D4D5595C4A2A702CFF4E94FF /* HeroImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EC2F1622C5BBABED6012E12 /* HeroImage.swift */; }; D4D7CCECC6C0AAFC42E165BB /* NotificationPermissionsScreenViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BE9BBB18FB27F09032AD8769 /* NotificationPermissionsScreenViewModel.swift */; }; D53B80EF02C1062E68659EDD /* ReportContentViewModelTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 086C19086DD16E9B38E25954 /* ReportContentViewModelTests.swift */; }; D55AF9B5B55FEED04771A461 /* RoomFlowCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A008E57D52B07B78DFAD1BB /* RoomFlowCoordinator.swift */; }; @@ -1134,6 +1133,7 @@ FB595EC9C00AB32F39034055 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5A37E2FACFD041CE466223CD /* SceneDelegate.swift */; }; FBD402E3170EB1ED0D1AA672 /* EncryptionKeyProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2355398E4A55DA5A89128AD1 /* EncryptionKeyProvider.swift */; }; FBF09B6C900415800DDF2A21 /* EmojiProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C113E0CB7E15E9765B1817A /* EmojiProvider.swift */; }; + FC0EEFF630F34899953BB950 /* BigIcon.swift in Sources */ = {isa = PBXBuildFile; fileRef = D01FD1171FF40E34D707FD00 /* BigIcon.swift */; }; FC10228E73323BDC09526F97 /* PostHog in Frameworks */ = {isa = PBXBuildFile; productRef = 4278261E147DB2DE5CFB7FC5 /* PostHog */; }; FC8B95EC506E6BB5793D81CE /* ClientProtocolTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E34685D186453E429ADEE58E /* ClientProtocolTests.swift */; }; FCD3F2B82CAB29A07887A127 /* KeychainAccess in Frameworks */ = {isa = PBXBuildFile; productRef = 2B43F2AF7456567FE37270A7 /* KeychainAccess */; }; @@ -1219,13 +1219,13 @@ 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; lastKnownFileType = file; path = test_voice_message.m4a; sourceTree = ""; }; + 0392E3FDE372C9B56FEEED8B /* test_voice_message.m4a */ = {isa = PBXFileReference; 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 = ""; }; 045253F9967A535EE5B16691 /* Label.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Label.swift; sourceTree = ""; }; 046C0D3F53B0B5EF0A1F5BEA /* RoomSummaryTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomSummaryTests.swift; sourceTree = ""; }; - 048A21188AB19349D026BECD /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = ""; }; + 048A21188AB19349D026BECD /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; path = PrivacyInfo.xcprivacy; sourceTree = ""; }; 04BB8DDE245ED86C489BA983 /* AccessibilityIdentifiers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccessibilityIdentifiers.swift; sourceTree = ""; }; 04DF593C3F7AF4B2FBAEB05D /* FileManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileManager.swift; sourceTree = ""; }; 0516C69708D5CBDE1A8E77EC /* RoomDirectorySearchProxyProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomDirectorySearchProxyProtocol.swift; sourceTree = ""; }; @@ -1291,7 +1291,7 @@ 127A57D053CE8C87B5EFB089 /* Consumable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Consumable.swift; sourceTree = ""; }; 127C8472672A5BA09EF1ACF8 /* CurrentValuePublisher.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CurrentValuePublisher.swift; sourceTree = ""; }; 128501375217576AF0FE3E92 /* RoomAttachmentPicker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomAttachmentPicker.swift; sourceTree = ""; }; - 1304D9191300873EADA52D6E /* IntegrationTests.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = IntegrationTests.xctestplan; sourceTree = ""; }; + 1304D9191300873EADA52D6E /* IntegrationTests.xctestplan */ = {isa = PBXFileReference; path = IntegrationTests.xctestplan; sourceTree = ""; }; 130ED565A078F7E0B59D9D25 /* UNTextInputNotificationResponse+Creator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UNTextInputNotificationResponse+Creator.swift"; sourceTree = ""; }; 136F80A613B55BDD071DCEA5 /* JoinRoomScreenModels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JoinRoomScreenModels.swift; sourceTree = ""; }; 13802897C7AFA360EA74C0B0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = en; path = en.lproj/Localizable.stringsdict; sourceTree = ""; }; @@ -1303,6 +1303,7 @@ 1575947B7A6FE08C57FE5EE4 /* NetworkMonitorProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkMonitorProtocol.swift; sourceTree = ""; }; 15A657D96779D1DEB8EF1327 /* CreateRoomViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CreateRoomViewModel.swift; sourceTree = ""; }; 161CD412E75F4086F422AE39 /* SessionVerificationScreenStateMachine.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SessionVerificationScreenStateMachine.swift; sourceTree = ""; }; + 1627F2D56477BD331F6D732C /* RoomHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomHeaderView.swift; sourceTree = ""; }; 16D09C79746BDCD9173EB3A7 /* RoomDetailsEditScreenModels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomDetailsEditScreenModels.swift; sourceTree = ""; }; 1715E3D7F53C0748AA50C91C /* PostHogAnalyticsClient.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PostHogAnalyticsClient.swift; sourceTree = ""; }; 1734A445A58ED855B977A0A8 /* TracingConfigurationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TracingConfigurationTests.swift; sourceTree = ""; }; @@ -1380,7 +1381,7 @@ 25F7FE40EF7490A7E09D7BE6 /* NotificationItemProxy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationItemProxy.swift; sourceTree = ""; }; 25F8664F1FB95AF3C4202478 /* PollFormScreenCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PollFormScreenCoordinator.swift; sourceTree = ""; }; 260004737C573A56FA01E86E /* Encodable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Encodable.swift; sourceTree = ""; }; - 267BB1D5B08A9511F894CB57 /* PreviewTests.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = PreviewTests.xctestplan; sourceTree = ""; }; + 267BB1D5B08A9511F894CB57 /* PreviewTests.xctestplan */ = {isa = PBXFileReference; path = PreviewTests.xctestplan; sourceTree = ""; }; 26B0A96B8FE4849227945067 /* VoiceMessageRecorder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VoiceMessageRecorder.swift; sourceTree = ""; }; 26EAAB54C6CE91D64B69A9F8 /* AppLockServiceProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppLockServiceProtocol.swift; sourceTree = ""; }; 2721D7B051F0159AA919DA05 /* RoomChangePermissionsScreenViewModelProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomChangePermissionsScreenViewModelProtocol.swift; sourceTree = ""; }; @@ -1451,7 +1452,7 @@ 3558A15CFB934F9229301527 /* RestorationToken.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RestorationToken.swift; sourceTree = ""; }; 35AFCF4C05DEED04E3DB1A16 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/Localizable.strings; sourceTree = ""; }; 35FA991289149D31F4286747 /* UserPreference.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserPreference.swift; sourceTree = ""; }; - 36DA824791172B9821EACBED /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = ""; }; + 36DA824791172B9821EACBED /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; path = PrivacyInfo.xcprivacy; sourceTree = ""; }; 36FD673E24FBFCFDF398716A /* RoomMemberProxyMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomMemberProxyMock.swift; sourceTree = ""; }; 376D941BF8BB294389C0DE24 /* MapTilerURLBuildersTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapTilerURLBuildersTests.swift; sourceTree = ""; }; 37A243E04B58DC6E41FDCD82 /* EmojiItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmojiItem.swift; sourceTree = ""; }; @@ -1507,7 +1508,6 @@ 421E716C521F96D24ECE69B3 /* NoticeRoomTimelineItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NoticeRoomTimelineItem.swift; sourceTree = ""; }; 421FA93BCC2840E66E4F306F /* NotificationSettingsScreenViewModelProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationSettingsScreenViewModelProtocol.swift; sourceTree = ""; }; 42236480CF0431535EBE8387 /* CustomLayoutLabelStyle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomLayoutLabelStyle.swift; sourceTree = ""; }; - 422724361B6555364C43281E /* RoomHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomHeaderView.swift; sourceTree = ""; }; 42C64A14EE89928207E3B42B /* AnalyticsSettingsScreenModels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnalyticsSettingsScreenModels.swift; sourceTree = ""; }; 42C8C368A611B9CB79C7F5FA /* RoomPollsHistoryScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomPollsHistoryScreen.swift; sourceTree = ""; }; 436A0D98D372B17EAE9AA999 /* GlobalSearchScreenModels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GlobalSearchScreenModels.swift; sourceTree = ""; }; @@ -1556,7 +1556,7 @@ 4B41FABA2B0AEF4389986495 /* LoginMode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginMode.swift; sourceTree = ""; }; 4BD371B60E07A5324B9507EF /* AnalyticsSettingsScreenCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnalyticsSettingsScreenCoordinator.swift; sourceTree = ""; }; 4C8D988E82A8DFA13BE46F7C /* pl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = pl; path = pl.lproj/Localizable.stringsdict; sourceTree = ""; }; - 4CD6AC7546E8D7E5C73CEA48 /* ElementX.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ElementX.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 4CD6AC7546E8D7E5C73CEA48 /* ElementX.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = ElementX.app; sourceTree = BUILT_PRODUCTS_DIR; }; 4CDDDDD9FE1A699D23A5E096 /* LoginScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginScreen.swift; sourceTree = ""; }; 4D3A7375AB22721C436EB056 /* ComposerToolbarModels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ComposerToolbarModels.swift; sourceTree = ""; }; 4E2245243369B99216C7D84E /* ImageCache.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageCache.swift; sourceTree = ""; }; @@ -1754,7 +1754,6 @@ 7E492690C8B27A892C194CC4 /* AdvancedSettingsScreenCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdvancedSettingsScreenCoordinator.swift; sourceTree = ""; }; 7E8562F4D7DE073BC32902AB /* EncryptionResetScreenViewModelProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EncryptionResetScreenViewModelProtocol.swift; sourceTree = ""; }; 7EB58E4E8D6D634C246AD5C2 /* RoomInviterLabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomInviterLabel.swift; sourceTree = ""; }; - 7EC2F1622C5BBABED6012E12 /* HeroImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeroImage.swift; sourceTree = ""; }; 7EECE8B331CD169790EF284F /* BugReportScreenViewModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BugReportScreenViewModelTests.swift; sourceTree = ""; }; 7F615A00DB223FF3280204D2 /* UserDiscoveryServiceProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserDiscoveryServiceProtocol.swift; sourceTree = ""; }; 7FB2253D36E81E045E1CB432 /* Duration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Duration.swift; sourceTree = ""; }; @@ -1824,7 +1823,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 = ""; }; 8DA1E8F287680C8ED25EDBAC /* NetworkMonitorMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkMonitorMock.swift; sourceTree = ""; }; - 8E088F2A1B9EC529D3221931 /* UITests.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = UITests.xctestplan; sourceTree = ""; }; + 8E088F2A1B9EC529D3221931 /* UITests.xctestplan */ = {isa = PBXFileReference; path = UITests.xctestplan; sourceTree = ""; }; 8E1584F8BCF407BB94F48F04 /* EncryptionResetPasswordScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EncryptionResetPasswordScreen.swift; sourceTree = ""; }; 8EAF4A49F3ACD8BB8B0D2371 /* ClientSDKMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClientSDKMock.swift; sourceTree = ""; }; 8F21ED7205048668BEB44A38 /* AppActivityView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppActivityView.swift; sourceTree = ""; }; @@ -2002,7 +2001,7 @@ B50F03079F6B5EF9CA005F14 /* TimelineProxyProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimelineProxyProtocol.swift; sourceTree = ""; }; B53AC78E49A297AC1D72A7CF /* AppMediator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppMediator.swift; sourceTree = ""; }; B590BD4507D4F0A377FDE01A /* LoadableAvatarImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoadableAvatarImage.swift; sourceTree = ""; }; - B61C339A2FDDBD067FF6635C /* ConfettiScene.scn */ = {isa = PBXFileReference; lastKnownFileType = file.bplist; path = ConfettiScene.scn; sourceTree = ""; }; + B61C339A2FDDBD067FF6635C /* ConfettiScene.scn */ = {isa = PBXFileReference; path = ConfettiScene.scn; sourceTree = ""; }; B63B69F9A2BC74DD40DC75C8 /* AdvancedSettingsScreenViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdvancedSettingsScreenViewModel.swift; sourceTree = ""; }; B6404166CBF5CC88673FF9E2 /* RoomDetails.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomDetails.swift; sourceTree = ""; }; B655A536341D2695158C6664 /* AuthenticationClientBuilderFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthenticationClientBuilderFactory.swift; sourceTree = ""; }; @@ -2117,7 +2116,8 @@ CDB3227C7A74B734924942E9 /* RoomSummaryProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomSummaryProvider.swift; sourceTree = ""; }; CDE3F3911FF7CC639BDE5844 /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/Localizable.strings; sourceTree = ""; }; CEE20623EB4A9B88FB29F2BA /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/SAS.strings; sourceTree = ""; }; - CEE41494C837AA403A06A5D9 /* UnitTests.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = UnitTests.xctestplan; sourceTree = ""; }; + CEE41494C837AA403A06A5D9 /* UnitTests.xctestplan */ = {isa = PBXFileReference; path = UnitTests.xctestplan; sourceTree = ""; }; + D01FD1171FF40E34D707FD00 /* BigIcon.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BigIcon.swift; sourceTree = ""; }; D071F86CD47582B9196C9D16 /* UserDiscoverySection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserDiscoverySection.swift; sourceTree = ""; }; D086854995173E897F993C26 /* AdvancedSettingsScreenViewModelProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdvancedSettingsScreenViewModelProtocol.swift; sourceTree = ""; }; D09A267106B9585D3D0CFC0D /* ClientError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClientError.swift; sourceTree = ""; }; @@ -2249,7 +2249,7 @@ ED0CBEAB5F796BEFBAF7BB6A /* VideoRoomTimelineView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VideoRoomTimelineView.swift; sourceTree = ""; }; ED1D792EB82506A19A72C8DE /* RoomTimelineItemProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomTimelineItemProtocol.swift; sourceTree = ""; }; ED33988DA4FD4FC666800106 /* SessionVerificationScreenViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SessionVerificationScreenViewModel.swift; sourceTree = ""; }; - ED482057AE39D5C6D9C5F3D8 /* message.caf */ = {isa = PBXFileReference; lastKnownFileType = file; path = message.caf; sourceTree = ""; }; + ED482057AE39D5C6D9C5F3D8 /* message.caf */ = {isa = PBXFileReference; path = message.caf; sourceTree = ""; }; ED49073BB1C1FC649DAC2CCD /* LocationRoomTimelineView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocationRoomTimelineView.swift; sourceTree = ""; }; ED60E4D2CD678E1EBF16F77A /* BlockedUsersScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BlockedUsersScreen.swift; sourceTree = ""; }; EE378083653EF0C9B5E9D580 /* EmoteRoomTimelineItemContent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmoteRoomTimelineItemContent.swift; sourceTree = ""; }; @@ -2271,7 +2271,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; lastKnownFileType = file; path = portrait_test_video.mp4; sourceTree = ""; }; + F2D513D2477B57F90E98EEC0 /* portrait_test_video.mp4 */ = {isa = PBXFileReference; path = portrait_test_video.mp4; sourceTree = ""; }; F2E4EF80DFB8FE7C4469B15D /* RoomDirectorySearchScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomDirectorySearchScreen.swift; 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 = ""; }; @@ -2289,7 +2289,7 @@ F5D8FEB1FED10E995CB002F7 /* TimelineBubbleLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimelineBubbleLayout.swift; sourceTree = ""; }; F5E23D8EE6CBACF32F1EC874 /* MediaPlayerProviderProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MediaPlayerProviderProtocol.swift; sourceTree = ""; }; F64A8582F65567AC38C2976A /* PollFormScreenViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PollFormScreenViewModel.swift; sourceTree = ""; }; - F6B676B4866F5B383DE819B2 /* test_apple_image.heic */ = {isa = PBXFileReference; lastKnownFileType = file; path = test_apple_image.heic; sourceTree = ""; }; + F6B676B4866F5B383DE819B2 /* test_apple_image.heic */ = {isa = PBXFileReference; path = test_apple_image.heic; sourceTree = ""; }; F72EFC8C634469F9262659C7 /* NSItemProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NSItemProvider.swift; sourceTree = ""; }; F733F135E6D67BBBEB76CC30 /* AppLockUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppLockUITests.swift; sourceTree = ""; }; F74532E01B317C56C1BE8FA8 /* RoomTimelineProviderMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomTimelineProviderMock.swift; sourceTree = ""; }; @@ -2960,8 +2960,8 @@ CC743C7A85E3171BCBF0A653 /* AvatarHeaderView.swift */, 9A028783CFFF861C5E44FFB1 /* BadgeLabel.swift */, C1FA515B3B0D61EF1E907D2D /* BadgeView.swift */, + D01FD1171FF40E34D707FD00 /* BigIcon.swift */, 8CC23C63849452BC86EA2852 /* ButtonStyle.swift */, - 7EC2F1622C5BBABED6012E12 /* HeroImage.swift */, B590BD4507D4F0A377FDE01A /* LoadableAvatarImage.swift */, C352359663A0E52BA20761EE /* LoadableImage.swift */, FFECCE59967018204876D0A5 /* LocationMarkerView.swift */, @@ -2969,12 +2969,12 @@ 648DD1C10E4957CB791FE0B8 /* OverridableAvatarImage.swift */, C705E605EF57C19DBE86FFA1 /* PlaceholderAvatarImage.swift */, BEF5FE93A06F563B477F024A /* RoomAvatarImage.swift */, + 1627F2D56477BD331F6D732C /* RoomHeaderView.swift */, 7EB58E4E8D6D634C246AD5C2 /* RoomInviterLabel.swift */, 839E2C35DF3F9C7B54C3CE49 /* RoundedCornerShape.swift */, DE7C80EF77AD102053D3646E /* RoundedLabelItem.swift */, AEB5FF7A09B79B0C6B528F7C /* SFNumberedListView.swift */, E10DA51DBC8C7E1460DBCCBD /* UserProfileListRow.swift */, - 422724361B6555364C43281E /* RoomHeaderView.swift */, ); path = Views; sourceTree = ""; @@ -6349,6 +6349,7 @@ D876EC0FED3B6D46C806912A /* AvatarSize.swift in Sources */, 7A25D6926A2C01DB8D0D67A5 /* BadgeLabel.swift in Sources */, A4B0BAD62A12ED76BD611B79 /* BadgeView.swift in Sources */, + FC0EEFF630F34899953BB950 /* BigIcon.swift in Sources */, 38546A6010A2CF240EC9AF73 /* BindableState.swift in Sources */, EB9F4688006B52E69DF5358F /* BlankFormCoordinator.swift in Sources */, 369BF960E52BBEE61F8A5BD1 /* BlockedUsersScreen.swift in Sources */, @@ -6500,7 +6501,6 @@ D34E328E9E65904358248FDD /* GlobalSearchScreenModels.swift in Sources */, 55D18AA4F4A2257642EBDB94 /* GlobalSearchScreenViewModel.swift in Sources */, E32A18802EB37EEE3EF7B965 /* GlobalSearchScreenViewModelProtocol.swift in Sources */, - D4D5595C4A2A702CFF4E94FF /* HeroImage.swift in Sources */, 0C1E537A49ABB386F7554D4A /* HighlightedTimelineItemModifier.swift in Sources */, 964B9D2EC38C488C360CE0C9 /* HomeScreen.swift in Sources */, 62C5876C4254C58C2086F0DE /* HomeScreenContent.swift in Sources */, @@ -6778,7 +6778,7 @@ 2814E7075BF3A5C0CCBC9F90 /* RoomDirectorySearchView.swift in Sources */, 42F1C8731166633E35A6D7E6 /* RoomEventStringBuilder.swift in Sources */, D55AF9B5B55FEED04771A461 /* RoomFlowCoordinator.swift in Sources */, - 04A16B45228F7678A027C079 /* RoomHeaderView.swift in Sources */, + 9C63171267E22FEB288EC860 /* RoomHeaderView.swift in Sources */, 8A83D715940378B9BA9F739E /* RoomInviterLabel.swift in Sources */, F4996C82A4B3A5FF0C8EDD03 /* RoomListFilterModels.swift in Sources */, 4A9CEEE612D6D8B3DDBD28BA /* RoomListFilterView.swift in Sources */, @@ -7301,7 +7301,9 @@ "@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; @@ -7350,7 +7352,9 @@ "@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)"; @@ -7376,7 +7380,9 @@ "@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)"; @@ -7621,7 +7627,9 @@ "@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/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-en-GB.Knocked.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-en-GB.Knocked.png index 0c7b3c0a4f..be7b7aed9e 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-en-GB.Knocked.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-en-GB.Knocked.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3de2000689563a5a4fa149245c305236ec0f42516c98c5112006f339537ffd60 -size 1981547 +oid sha256:e0070dcdfe989211600c14fdb7b96af79cfb2b50ae8c3d560f7fe738b368be48 +size 1982637 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-pseudo.Knocked.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-pseudo.Knocked.png index 7a54965071..1a6c7a7702 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-pseudo.Knocked.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPad-pseudo.Knocked.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:879b20b02098aacfd712cafc012629cd2d20a128474962da18a675cb78fa3e24 -size 1998640 +oid sha256:8283d5d60db3b91caa096216e4dbb1d5e5342375080c81e5814acbb01b41c8c9 +size 2000079 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-en-GB.Knocked.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-en-GB.Knocked.png index cd87d24b44..8db4a97964 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-en-GB.Knocked.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-en-GB.Knocked.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e405d83b38b72125a22af8f32e5dfa3c7a9bba65ae7f7acbeddc9d27d87d80be -size 817932 +oid sha256:19d3b48e373ed4e263c9cb0f6e5a3566a9c6612f19da8468be420eca0a10cd92 +size 819795 diff --git a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-pseudo.Knocked.png b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-pseudo.Knocked.png index 0612a40add..8407998f15 100644 --- a/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-pseudo.Knocked.png +++ b/PreviewTests/Sources/__Snapshots__/PreviewTests/test_joinRoomScreen-iPhone-16-pseudo.Knocked.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d3e473eba8ecd60d96375d75816b626fc4c42abfa62fc30e6a42b060aa005d26 -size 834574 +oid sha256:eb3a1c2ac88a74a4f9c402a46a8512abc2596937b92c3d17fa30a7cdf10ce22a +size 835796 From b839d236957f755782d98b5ae74b6a8743d06005 Mon Sep 17 00:00:00 2001 From: Mauro Romito Date: Thu, 24 Oct 2024 16:25:26 +0200 Subject: [PATCH 18/20] added message as reason --- ElementX/Sources/Services/Client/ClientProxy.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ElementX/Sources/Services/Client/ClientProxy.swift b/ElementX/Sources/Services/Client/ClientProxy.swift index 643b8844ef..0bba67ad5e 100644 --- a/ElementX/Sources/Services/Client/ClientProxy.swift +++ b/ElementX/Sources/Services/Client/ClientProxy.swift @@ -417,7 +417,7 @@ class ClientProxy: ClientProxyProtocol { func knockRoom(_ roomID: String, via: [String], message: String?) async -> Result { do { - let _ = try await client.knock(roomIdOrAlias: roomID, reason: nil, serverNames: via) + let _ = try await client.knock(roomIdOrAlias: roomID, reason: message, serverNames: via) await waitForRoomToSync(roomID: roomID, timeout: .seconds(30)) return .success(()) } catch { @@ -428,7 +428,7 @@ class ClientProxy: ClientProxyProtocol { func knockRoomAlias(_ roomAlias: String, message: String?) async -> Result { do { - let room = try await client.knock(roomIdOrAlias: roomAlias, reason: nil, serverNames: []) + let room = try await client.knock(roomIdOrAlias: roomAlias, reason: message, serverNames: []) await waitForRoomToSync(roomID: room.id(), timeout: .seconds(30)) return .success(()) } catch { From 924a264bb5dd1625e0753211c41ad1c823c78b13 Mon Sep 17 00:00:00 2001 From: Mauro Romito Date: Thu, 24 Oct 2024 16:31:31 +0200 Subject: [PATCH 19/20] updated strings --- .../Localizations/en.lproj/Localizable.strings | 7 ++++++- ElementX/Sources/Generated/Strings.swift | 12 +++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/ElementX/Resources/Localizations/en.lproj/Localizable.strings b/ElementX/Resources/Localizations/en.lproj/Localizable.strings index 6e49740a0e..4aeb3bef7b 100644 --- a/ElementX/Resources/Localizations/en.lproj/Localizable.strings +++ b/ElementX/Resources/Localizations/en.lproj/Localizable.strings @@ -371,6 +371,7 @@ "screen_room_pinned_banner_loading_description" = "Loading message…"; "screen_room_pinned_banner_view_all_button_title" = "View All"; "screen_room_details_pinned_events_row_title" = "Pinned messages"; +"screen_roomlist_knock_event_sent_description" = "Request to join sent"; "screen_timeline_item_menu_send_failure_changed_identity" = "Message not sent because %1$@’s verified identity has changed."; "screen_timeline_item_menu_send_failure_unsigned_device" = "Message not sent because %1$@ has not verified all devices."; "screen_timeline_item_menu_send_failure_you_unsigned_device" = "Message not sent because you have not verified one or more of your devices."; @@ -822,12 +823,16 @@ "screen_session_verification_open_existing_session_title" = "Open an existing session"; "screen_session_verification_positive_button_canceled" = "Retry verification"; "screen_session_verification_positive_button_initial" = "I am ready"; -"screen_session_verification_positive_button_verifying_ongoing" = "Waiting to match"; +"screen_session_verification_positive_button_verifying_ongoing" = "Waiting to match…"; "screen_session_verification_ready_subtitle" = "Compare a unique set of emojis."; "screen_session_verification_request_accepted_subtitle" = "Compare the unique emoji, ensuring they appear in the same order."; "screen_session_verification_request_details_timestamp" = "Signed in"; +"screen_session_verification_request_failure_subtitle" = "Either the request timed out, the request was denied, or there was a verification mismatch."; +"screen_session_verification_request_failure_title" = "Verification failed"; "screen_session_verification_request_footer" = "Only continue if you initiated this verification."; "screen_session_verification_request_subtitle" = "Verify the other device to keep your message history secure."; +"screen_session_verification_request_success_subtitle" = "Now you can read or send messages securely on your other device."; +"screen_session_verification_request_success_title" = "Device verified"; "screen_session_verification_request_title" = "Verification requested"; "screen_session_verification_they_dont_match" = "They don’t match"; "screen_session_verification_they_match" = "They match"; diff --git a/ElementX/Sources/Generated/Strings.swift b/ElementX/Sources/Generated/Strings.swift index 2439a43468..a9fef6619b 100644 --- a/ElementX/Sources/Generated/Strings.swift +++ b/ElementX/Sources/Generated/Strings.swift @@ -1965,6 +1965,8 @@ internal enum L10n { /// Congrats! /// You don’t have any unread messages! internal static var screenRoomlistFilterUnreadsEmptyStateTitle: String { return L10n.tr("Localizable", "screen_roomlist_filter_unreads_empty_state_title") } + /// Request to join sent + internal static var screenRoomlistKnockEventSentDescription: String { return L10n.tr("Localizable", "screen_roomlist_knock_event_sent_description") } /// Chats internal static var screenRoomlistMainSpaceTitle: String { return L10n.tr("Localizable", "screen_roomlist_main_space_title") } /// Mark as read @@ -2013,7 +2015,7 @@ internal enum L10n { internal static var screenSessionVerificationPositiveButtonCanceled: String { return L10n.tr("Localizable", "screen_session_verification_positive_button_canceled") } /// I am ready internal static var screenSessionVerificationPositiveButtonInitial: String { return L10n.tr("Localizable", "screen_session_verification_positive_button_initial") } - /// Waiting to match + /// Waiting to match… internal static var screenSessionVerificationPositiveButtonVerifyingOngoing: String { return L10n.tr("Localizable", "screen_session_verification_positive_button_verifying_ongoing") } /// Compare a unique set of emojis. internal static var screenSessionVerificationReadySubtitle: String { return L10n.tr("Localizable", "screen_session_verification_ready_subtitle") } @@ -2021,10 +2023,18 @@ internal enum L10n { internal static var screenSessionVerificationRequestAcceptedSubtitle: String { return L10n.tr("Localizable", "screen_session_verification_request_accepted_subtitle") } /// Signed in internal static var screenSessionVerificationRequestDetailsTimestamp: String { return L10n.tr("Localizable", "screen_session_verification_request_details_timestamp") } + /// Either the request timed out, the request was denied, or there was a verification mismatch. + internal static var screenSessionVerificationRequestFailureSubtitle: String { return L10n.tr("Localizable", "screen_session_verification_request_failure_subtitle") } + /// Verification failed + internal static var screenSessionVerificationRequestFailureTitle: String { return L10n.tr("Localizable", "screen_session_verification_request_failure_title") } /// Only continue if you initiated this verification. internal static var screenSessionVerificationRequestFooter: String { return L10n.tr("Localizable", "screen_session_verification_request_footer") } /// Verify the other device to keep your message history secure. internal static var screenSessionVerificationRequestSubtitle: String { return L10n.tr("Localizable", "screen_session_verification_request_subtitle") } + /// Now you can read or send messages securely on your other device. + internal static var screenSessionVerificationRequestSuccessSubtitle: String { return L10n.tr("Localizable", "screen_session_verification_request_success_subtitle") } + /// Device verified + internal static var screenSessionVerificationRequestSuccessTitle: String { return L10n.tr("Localizable", "screen_session_verification_request_success_title") } /// Verification requested internal static var screenSessionVerificationRequestTitle: String { return L10n.tr("Localizable", "screen_session_verification_request_title") } /// They don’t match From 724bfa7ba3be667505df0d0c5b25635c9aa3738e Mon Sep 17 00:00:00 2001 From: Mauro Romito Date: Thu, 24 Oct 2024 16:46:49 +0200 Subject: [PATCH 20/20] fixing tests --- UnitTests/Sources/LoggingTests.swift | 1 - UnitTests/Sources/RoomSummaryTests.swift | 1 - 2 files changed, 2 deletions(-) diff --git a/UnitTests/Sources/LoggingTests.swift b/UnitTests/Sources/LoggingTests.swift index e5370a37a5..3ab0e77fdd 100644 --- a/UnitTests/Sources/LoggingTests.swift +++ b/UnitTests/Sources/LoggingTests.swift @@ -81,7 +81,6 @@ class LoggingTests: XCTestCase { let roomSummary = RoomSummary(roomListItem: .init(noPointer: .init()), id: "myroomid", joinRequestType: nil, - inviter: nil, name: roomName, isDirect: true, avatarURL: nil, diff --git a/UnitTests/Sources/RoomSummaryTests.swift b/UnitTests/Sources/RoomSummaryTests.swift index 84e8820e0f..2626351eb4 100644 --- a/UnitTests/Sources/RoomSummaryTests.swift +++ b/UnitTests/Sources/RoomSummaryTests.swift @@ -57,7 +57,6 @@ class RoomSummaryTests: XCTestCase { RoomSummary(roomListItem: .init(noPointer: .init()), id: roomDetails.id, joinRequestType: nil, - inviter: nil, name: roomDetails.name, isDirect: isDirect, avatarURL: hasRoomAvatar ? roomDetails.avatarURL : nil,