mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-23 01:52:44 +02:00
222f3292a2
# Conflicts: # .github/workflows/ci-build.yml # .github/workflows/ci-tests.yml # .github/workflows/release-alpha.yml # .github/workflows/triage-move-labelled.yml # .github/workflows/triage-priority-bugs.yml # .gitignore # CHANGES.md # Config/AppConfiguration.swift # Config/AppIdentifiers.xcconfig # Config/AppVersion.xcconfig # Config/BuildSettings.swift # Config/CommonConfiguration.swift # Gemfile # Gemfile.lock # IDETemplateMacros.plist # Podfile # Podfile.lock # README.md # Riot.xcodeproj/xcshareddata/xcschemes/Riot.xcscheme # Riot/Assets/Images.xcassets/Common/reveal_password_button.imageset/reveal_password_button.png # Riot/Assets/Images.xcassets/Common/reveal_password_button.imageset/reveal_password_button@2x.png # Riot/Assets/Images.xcassets/Common/reveal_password_button.imageset/reveal_password_button@3x.png # Riot/Assets/Images.xcassets/People/people_floating_action.imageset/Contents.json # Riot/Assets/Images.xcassets/Rooms/rooms_floating_action.imageset/Contents.json # Riot/Assets/Images.xcassets/Secrets/Recovery/secrets_recovery_key.imageset/Contents.json # Riot/Assets/Images.xcassets/Secrets/Recovery/secrets_recovery_passphrase.imageset/Contents.json # Riot/Assets/Images.xcassets/Secrets/Setup/secrets_setup_key.imageset/Contents.json # Riot/Assets/Images.xcassets/Secrets/Setup/secrets_setup_passphrase.imageset/Contents.json # Riot/Assets/Images.xcassets/TabBar/tab_people.imageset/Contents.json # Riot/Assets/Images.xcassets/TabBar/tab_rooms.imageset/Contents.json # Riot/Assets/SharedImages.xcassets/AppIcon.appiconset/Contents.json # Riot/Assets/SharedImages.xcassets/horizontal_logo.imageset/Contents.json # Riot/Assets/ar.lproj/InfoPlist.strings # Riot/Assets/cs.lproj/Vector.strings # Riot/Assets/de.lproj/InfoPlist.strings # Riot/Assets/de.lproj/Localizable.strings # Riot/Assets/de.lproj/Vector.strings # Riot/Assets/en.lproj/Localizable.strings # Riot/Assets/en.lproj/Untranslated.strings # Riot/Assets/en.lproj/Vector.strings # Riot/Assets/es.lproj/InfoPlist.strings # Riot/Assets/es.lproj/Vector.strings # Riot/Assets/et.lproj/InfoPlist.strings # Riot/Assets/et.lproj/Vector.strings # Riot/Assets/fr.lproj/InfoPlist.strings # Riot/Assets/fr.lproj/Vector.strings # Riot/Assets/hu.lproj/InfoPlist.strings # Riot/Assets/hu.lproj/Vector.strings # Riot/Assets/id.lproj/InfoPlist.strings # Riot/Assets/id.lproj/Vector.strings # Riot/Assets/is.lproj/InfoPlist.strings # Riot/Assets/is.lproj/Vector.strings # Riot/Assets/it.lproj/InfoPlist.strings # Riot/Assets/it.lproj/Vector.strings # Riot/Assets/ja.lproj/InfoPlist.strings # Riot/Assets/ja.lproj/Localizable.strings # Riot/Assets/ja.lproj/Vector.strings # Riot/Assets/nl.lproj/InfoPlist.strings # Riot/Assets/nl.lproj/Vector.strings # Riot/Assets/pl.lproj/InfoPlist.strings # Riot/Assets/pl.lproj/Vector.strings # Riot/Assets/pt_BR.lproj/InfoPlist.strings # Riot/Assets/pt_BR.lproj/Vector.strings # Riot/Assets/ru.lproj/InfoPlist.strings # Riot/Assets/ru.lproj/Vector.strings # Riot/Assets/sk.lproj/InfoPlist.strings # Riot/Assets/sk.lproj/Vector.strings # Riot/Assets/sq.lproj/InfoPlist.strings # Riot/Assets/sq.lproj/Vector.strings # Riot/Assets/sv.lproj/InfoPlist.strings # Riot/Assets/sv.lproj/Vector.strings # Riot/Assets/third_party_licenses.html # Riot/Assets/uk.lproj/InfoPlist.strings # Riot/Assets/uk.lproj/Vector.strings # Riot/Assets/zh_Hans.lproj/InfoPlist.strings # Riot/Assets/zh_Hans.lproj/Localizable.strings # Riot/Assets/zh_Hans.lproj/Vector.strings # Riot/Assets/zh_Hant.lproj/Vector.strings # Riot/Categories/MXKRoomBubbleTableViewCell+Riot.h # Riot/Categories/MXKRoomBubbleTableViewCell+Riot.m # Riot/Categories/MXRestClient+Async.swift # Riot/Categories/MXSession+Riot.m # Riot/Categories/NSAttributedString.swift # Riot/Categories/Publisher+Riot.swift # Riot/Categories/RoomBubbleCellData.swift # Riot/Categories/UILabel.swift # Riot/Categories/UIScrollView.swift # Riot/Categories/UIView.swift # Riot/Categories/UIViewController.swift # Riot/Generated/Images.swift # Riot/Generated/Strings.swift # Riot/Generated/UntranslatedStrings.swift # Riot/Managers/EncryptionKeyManager/EncryptionKeyManager.swift # Riot/Managers/LocalAuthentication/LocalAuthenticationService.swift # Riot/Managers/PushNotification/PushNotificationService.m # Riot/Managers/PushNotification/PushNotificationStore.swift # Riot/Managers/Settings/RiotSettings.swift # Riot/Managers/Settings/Shared/RiotSharedSettings.swift # Riot/Managers/Theme/Themes/DarkTheme.swift # Riot/Managers/Theme/Themes/DefaultTheme.swift # Riot/Managers/UISIAutoReporter/UISIAutoReporter.swift # Riot/Model/HomeserverConfiguration/HomeserverConfigurationBuilder.swift # Riot/Modules/Analytics/Analytics.swift # Riot/Modules/Analytics/AnalyticsUIElement.swift # Riot/Modules/Analytics/DecryptionFailureTracker.m # Riot/Modules/Application/AppCoordinator.swift # Riot/Modules/Application/LegacyAppDelegate.h # Riot/Modules/Application/LegacyAppDelegate.m # Riot/Modules/Authentication/AuthenticationCoordinatorProtocol.swift # Riot/Modules/Common/Avatar/AvatarView.swift # Riot/Modules/Common/Recents/DataSources/RecentsDataSource.h # Riot/Modules/Common/Recents/DataSources/RecentsDataSource.m # Riot/Modules/Common/Recents/RecentsViewController.h # Riot/Modules/Common/Recents/RecentsViewController.m # Riot/Modules/Common/Recents/Views/RecentTableViewCell.m # Riot/Modules/Common/SwiftUI/VectorHostingController.swift # Riot/Modules/Common/Toasts/RoundedToastView.swift # Riot/Modules/Common/Toasts/ToastViewState.swift # Riot/Modules/Common/UserIndicators/UserIndicatorPresenter.swift # Riot/Modules/Common/UserIndicators/UserIndicatorStore.swift # Riot/Modules/Common/UserIndicators/ViewPresenters/ToastViewPresenter.swift # Riot/Modules/Common/WebViewController/WebViewViewController.m # Riot/Modules/Communities/Home/GroupHomeViewController.m # Riot/Modules/Communities/Members/GroupParticipantsViewController.m # Riot/Modules/Communities/Rooms/GroupRoomsViewController.m # Riot/Modules/Contacts/ContactsTableViewController.m # Riot/Modules/Contacts/ContactsTableViewController.xib # Riot/Modules/Contacts/Details/ContactDetailsViewController.m # Riot/Modules/Contacts/Views/ContactTableViewCell.m # Riot/Modules/Contacts/Views/ContactTableViewCell.xib # Riot/Modules/ContextMenu/ActionProviders/RoomActionProvider.swift # Riot/Modules/ContextMenu/Services/RoomContextActionService.swift # Riot/Modules/CreateRoom/CreateRoomCoordinator.swift # Riot/Modules/CreateRoom/EnterNewRoomDetails/EnterNewRoomDetailsCoordinator.swift # Riot/Modules/CreateRoom/EnterNewRoomDetails/EnterNewRoomDetailsViewController.swift # Riot/Modules/CreateRoom/EnterNewRoomDetails/EnterNewRoomDetailsViewModel.swift # Riot/Modules/DeepLink/UniversalLinkParameters.swift # Riot/Modules/Favorites/FavouritesViewController.h # Riot/Modules/Favorites/FavouritesViewController.m # Riot/Modules/GlobalSearch/UnifiedSearchViewController.m # Riot/Modules/Home/HomeViewController.m # Riot/Modules/Home/Views/RoomCollectionViewCell.m # Riot/Modules/Integrations/WidgetPicker/WidgetPickerViewController.m # Riot/Modules/Integrations/Widgets/StickerPicker/StickerPickerViewController.m # Riot/Modules/KeyBackup/ManualExport/EncryptionKeysExportPresenter.swift # Riot/Modules/KeyVerification/Common/KeyVerificationCoordinator.swift # Riot/Modules/KeyVerification/Common/Verify/Scanning/KeyVerificationVerifyByScanningViewController.swift # Riot/Modules/KeyVerification/Device/SelfVerifyWait/KeyVerificationSelfVerifyWaitCoordinator.swift # Riot/Modules/KeyVerification/Device/SelfVerifyWait/KeyVerificationSelfVerifyWaitViewController.storyboard # Riot/Modules/KeyVerification/Device/SelfVerifyWait/KeyVerificationSelfVerifyWaitViewController.swift # Riot/Modules/KeyVerification/User/SessionStatus/UserVerificationSessionStatusViewController.swift # Riot/Modules/LocationSharing/LocationManager.swift # Riot/Modules/LocationSharing/UserLocationService.swift # Riot/Modules/LocationSharing/UserLocationServiceProvider.swift # Riot/Modules/MatrixKit/Categories/NSBundle+MatrixKit.m # Riot/Modules/MatrixKit/Controllers/MXKAccountDetailsViewController.m # Riot/Modules/MatrixKit/Controllers/MXKAuthenticationViewController.m # Riot/Modules/MatrixKit/Controllers/MXKRoomMemberDetailsViewController.h # Riot/Modules/MatrixKit/Controllers/MXKViewController.h # Riot/Modules/MatrixKit/Models/Account/MXKAccount.h # Riot/Modules/MatrixKit/Models/Account/MXKAccount.m # Riot/Modules/MatrixKit/Models/Account/MXKAccountManager.h # Riot/Modules/MatrixKit/Models/Account/MXKAccountManager.m # Riot/Modules/MatrixKit/Models/Contact/MXKContact.h # Riot/Modules/MatrixKit/Models/Room/MXKRoomBubbleCellData.h # Riot/Modules/MatrixKit/Models/Room/MXKRoomBubbleCellData.m # Riot/Modules/MatrixKit/Models/Room/MXKRoomBubbleCellDataStoring.h # Riot/Modules/MatrixKit/Models/Room/MXKRoomBubbleCellDataWithAppendingMode.m # Riot/Modules/MatrixKit/Models/Room/MXKRoomBubbleComponent.h # Riot/Modules/MatrixKit/Models/Room/MXKRoomBubbleComponent.m # Riot/Modules/MatrixKit/Models/Room/MXKRoomDataSource.m # Riot/Modules/MatrixKit/Models/Room/MXKSendReplyEventStringLocalizer.swift # Riot/Modules/MatrixKit/Utils/ErrorPresentation/MXKErrorPresentableBuilder.m # Riot/Modules/MatrixKit/Utils/EventFormatter/MXKEventFormatter.h # Riot/Modules/MatrixKit/Utils/EventFormatter/MXKEventFormatter.m # Riot/Modules/MatrixKit/Utils/MXKTools.h # Riot/Modules/MatrixKit/Utils/MXKTools.m # Riot/Modules/MatrixKit/Views/Account/MXKAccountTableViewCell.m # Riot/Modules/MatrixKit/Views/MXKTableViewCell/MXKTableViewCellWithLabelAndTextField.xib # Riot/Modules/MatrixKit/Views/MXKTableViewCell/MXKTableViewCellWithTextFieldAndButton.m # Riot/Modules/MatrixKit/Views/RoomInputToolbar/MXKRoomInputToolbarView.m # Riot/Modules/MatrixKit/Views/RoomMemberList/MXKRoomMemberTableViewCell.m # Riot/Modules/MediaPicker/MediaPickerViewController.m # Riot/Modules/MediaPicker/SingleImagePickerPresenter.swift # Riot/Modules/MediaPickerV2/MediaPickerPresenter.swift # Riot/Modules/Onboarding/OnboardingCoordinator.swift # Riot/Modules/Onboarding/OnboardingCoordinatorBridgePresenter.swift # Riot/Modules/Onboarding/OnboardingCoordinatorProtocol.swift # Riot/Modules/People/PeopleViewController.h # Riot/Modules/People/PeopleViewController.m # Riot/Modules/Pills/PillTextAttachment.swift # Riot/Modules/Pills/PillsFormatter.swift # Riot/Modules/QRCode/QRCodeGenerator.swift # Riot/Modules/Room/CellData/RoomBubbleCellData.m # Riot/Modules/Room/ContextualMenu/ReactionsMenu/ReactionsMenuViewModel.swift # Riot/Modules/Room/CreationModal/RoomCreationEventsModal/RoomCreationEventsModalCoordinator.swift # Riot/Modules/Room/CreationModal/RoomCreationEventsModal/RoomCreationEventsModalViewModel.swift # Riot/Modules/Room/CreationModal/RoomCreationModalCoordinatorBridgePresenter.swift # Riot/Modules/Room/DataSources/RoomDataSource.m # Riot/Modules/Room/DataSources/RoomDataSource.swift # Riot/Modules/Room/EditHistory/EditHistoryViewModel.swift # Riot/Modules/Room/Files/RoomFilesViewController.m # Riot/Modules/Room/Location/RoomTimelineLocationView.swift # Riot/Modules/Room/Location/RoomTimelineLocationView.xib # Riot/Modules/Room/MXKRoomViewController.h # Riot/Modules/Room/MXKRoomViewController.m # Riot/Modules/Room/Members/Detail/RoomMemberDetailsViewController.h # Riot/Modules/Room/Members/Detail/RoomMemberDetailsViewController.m # Riot/Modules/Room/Members/RoomParticipantsViewController.h # Riot/Modules/Room/Members/RoomParticipantsViewController.m # Riot/Modules/Room/ParticipantsInviteModal/ContactsPicker/ContactsPickerViewModel.swift # Riot/Modules/Room/RoomCoordinator.swift # Riot/Modules/Room/RoomInfo/RoomInfoCoordinator.swift # Riot/Modules/Room/RoomInfo/RoomInfoList/RoomInfoListViewAction.swift # Riot/Modules/Room/RoomInfo/RoomInfoList/RoomInfoListViewController.swift # Riot/Modules/Room/RoomInfo/RoomInfoList/RoomInfoListViewModel.swift # Riot/Modules/Room/RoomInfo/RoomInfoList/RoomInfoListViewModelType.swift # Riot/Modules/Room/RoomInfo/RoomInfoList/RoomInfoListViewState.swift # Riot/Modules/Room/RoomInfo/RoomInfoList/Views/RoomInfoBasicView.swift # Riot/Modules/Room/RoomViewController.m # Riot/Modules/Room/Settings/RoomSettingsViewController.m # Riot/Modules/Room/TimelineCells/BaseRoomCell/RoomCellContentView.xib # Riot/Modules/Room/TimelineCells/Common/MXKRoomBubbleTableViewCell.m # Riot/Modules/Room/TimelineCells/RoomCreationIntro/RoomCreationIntroCell.swift # Riot/Modules/Room/TimelineCells/RoomCreationIntro/RoomCreationIntroCellContentView.swift # Riot/Modules/Room/TimelineCells/RoomCreationIntro/RoomCreationIntroViewData.swift # Riot/Modules/Room/TimelineCells/RoomMembership/RoomMembershipCollapsedBubbleCell.m # Riot/Modules/Room/TimelineCells/RoomTimelineCellIdentifier.h # Riot/Modules/Room/TimelineCells/Styles/Bubble/BubbleRoomTimelineCellProvider.m # Riot/Modules/Room/TimelineCells/Styles/Bubble/BubbleRoomTimelineStyle.swift # Riot/Modules/Room/TimelineCells/Styles/Bubble/Cells/FileWithoutThumbnail/Common/FileWithoutThumbnailBaseBubbleCell.swift # Riot/Modules/Room/TimelineCells/Styles/Bubble/Cells/FileWithoutThumbnail/Common/FileWithoutThumbnailCellContentView.swift # Riot/Modules/Room/TimelineCells/Styles/Bubble/Cells/FileWithoutThumbnail/Common/FileWithoutThumbnailCellContentView.xib # Riot/Modules/Room/TimelineCells/Styles/Plain/Cells/FileAttachment/Incoming/Clear/RoomIncomingAttachmentBubbleCell.xib # Riot/Modules/Room/TimelineCells/Styles/Plain/Cells/FileAttachment/Incoming/Clear/RoomIncomingAttachmentWithPaginationTitleBubbleCell.xib # Riot/Modules/Room/TimelineCells/Styles/Plain/Cells/FileAttachment/Incoming/Encrypted/RoomIncomingEncryptedAttachmentBubbleCell.xib # Riot/Modules/Room/TimelineCells/Styles/Plain/Cells/FileAttachment/Incoming/Encrypted/RoomIncomingEncryptedAttachmentWithPaginationTitleBubbleCell.xib # Riot/Modules/Room/TimelineCells/Styles/Plain/Cells/FileAttachment/Outgoing/Clear/RoomOutgoingAttachmentBubbleCell.xib # Riot/Modules/Room/TimelineCells/Styles/Plain/Cells/FileAttachment/Outgoing/Clear/RoomOutgoingAttachmentWithPaginationTitleBubbleCell.xib # Riot/Modules/Room/TimelineCells/Styles/Plain/Cells/FileAttachment/Outgoing/Encrypted/RoomOutgoingEncryptedAttachmentBubbleCell.xib # Riot/Modules/Room/TimelineCells/Styles/Plain/Cells/FileAttachment/Outgoing/Encrypted/RoomOutgoingEncryptedAttachmentWithPaginationTitleBubbleCell.xib # Riot/Modules/Room/TimelineCells/Styles/Plain/Cells/Location/LocationPlainCell.swift # Riot/Modules/Room/TimelineCells/Styles/Plain/Cells/Poll/PollPlainCell.swift # Riot/Modules/Room/TimelineCells/Styles/Plain/Cells/Sticker/RoomSelectedStickerBubbleCell.xib # Riot/Modules/Room/TimelineCells/Styles/Plain/Cells/TextMessage/Incoming/Clear/RoomIncomingTextMsgBubbleCell.xib # Riot/Modules/Room/TimelineCells/Styles/Plain/Cells/TextMessage/Incoming/Clear/RoomIncomingTextMsgWithPaginationTitleBubbleCell.xib # Riot/Modules/Room/TimelineCells/Styles/Plain/Cells/TextMessage/Incoming/Encrypted/RoomIncomingEncryptedTextMsgBubbleCell.xib # Riot/Modules/Room/TimelineCells/Styles/Plain/Cells/TextMessage/Incoming/Encrypted/RoomIncomingEncryptedTextMsgWithPaginationTitleBubbleCell.xib # Riot/Modules/Room/TimelineCells/Styles/Plain/Cells/TextMessage/Outgoing/Clear/RoomOutgoingTextMsgBubbleCell.xib # Riot/Modules/Room/TimelineCells/Styles/Plain/Cells/TextMessage/Outgoing/Clear/RoomOutgoingTextMsgWithPaginationTitleBubbleCell.xib # Riot/Modules/Room/TimelineCells/Styles/Plain/Cells/TextMessage/Outgoing/Encrypted/RoomOutgoingEncryptedTextMsgBubbleCell.xib # Riot/Modules/Room/TimelineCells/Styles/Plain/Cells/TextMessage/Outgoing/Encrypted/RoomOutgoingEncryptedTextMsgWithPaginationTitleBubbleCell.xib # Riot/Modules/Room/TimelineCells/Styles/Plain/PlainRoomTimelineCellProvider.m # Riot/Modules/Room/TimelineCells/Styles/Plain/PlainRoomTimelineStyle.swift # Riot/Modules/Room/TimelineCells/Styles/RoomTimelineStyle.swift # Riot/Modules/Room/TimelineDecorations/Reactions/RoomReactionActionViewCell.swift # Riot/Modules/Room/TimelineDecorations/Reactions/RoomReactionActionViewCell.xib # Riot/Modules/Room/TimelineDecorations/Reactions/RoomReactionViewCell.xib # Riot/Modules/Room/TimelineDecorations/Reactions/RoomReactionsView.swift # Riot/Modules/Room/TimelineDecorations/Reactions/RoomReactionsViewModel.swift # Riot/Modules/Room/TimelineDecorations/Reactions/RoomReactionsViewModelType.swift # Riot/Modules/Room/TimelineDecorations/Threads/Summary/ThreadSummaryView.swift # Riot/Modules/Room/VoiceMessages/VoiceMessageAudioConverter.swift # Riot/Modules/Room/VoiceMessages/VoiceMessageAudioRecorder.swift # Riot/Modules/Room/VoiceMessages/VoiceMessagePlaybackView.swift # Riot/Modules/Room/VoiceMessages/VoiceMessagePlaybackView.xib # Riot/Modules/Room/VoiceMessages/VoiceMessageToolbarView.swift # Riot/Modules/Rooms/RoomsViewController.h # Riot/Modules/Rooms/ShowDirectory/Cells/Network/DirectoryNetworkTableHeaderFooterView.swift # Riot/Modules/Rooms/ShowDirectory/Cells/Room/DirectoryRoomTableViewCell.swift # Riot/Modules/Rooms/ShowDirectory/Cells/Room/DirectoryRoomTableViewCell.xib # Riot/Modules/Rooms/ShowDirectory/PublicRoomsDirectoryViewModel.swift # Riot/Modules/Rooms/ShowDirectory/ShowDirectoryViewController.swift # Riot/Modules/Rooms/ShowDirectory/ShowDirectoryViewModel.swift # Riot/Modules/Secrets/Recover/RecoverWithKey/SecretsRecoveryWithKeyCoordinator.swift # Riot/Modules/Secrets/Recover/RecoverWithKey/SecretsRecoveryWithKeyViewController.swift # Riot/Modules/Secrets/Recover/RecoverWithPassphrase/SecretsRecoveryWithPassphraseCoordinator.swift # Riot/Modules/Secrets/Recover/RecoverWithPassphrase/SecretsRecoveryWithPassphraseViewController.swift # Riot/Modules/Secrets/Recover/SecretsRecoveryCoordinator.swift # Riot/Modules/Secrets/Reset/SecretsResetViewController.storyboard # Riot/Modules/Secrets/Reset/SecretsResetViewController.swift # Riot/Modules/Secrets/Setup/RecoveryKey/SecretsSetupRecoveryKeyViewController.swift # Riot/Modules/Secrets/Setup/RecoveryPassphrase/SecretsSetupRecoveryPassphraseViewController.storyboard # Riot/Modules/Secrets/Setup/RecoveryPassphrase/SecretsSetupRecoveryPassphraseViewController.swift # Riot/Modules/SecureBackup/Setup/Intro/SecureBackupSetupIntroViewController.swift # Riot/Modules/SecureBackup/Setup/Intro/SecureBackupSetupIntroViewModel.swift # Riot/Modules/SecureBackup/Setup/Intro/SecureBackupSetupIntroViewModelType.swift # Riot/Modules/SecureBackup/Setup/SecureBackupSetupCoordinator.swift # Riot/Modules/SetPinCode/EnterPinCode/EnterPinCodeViewController.storyboard # Riot/Modules/SetPinCode/EnterPinCode/EnterPinCodeViewController.swift # Riot/Modules/SetPinCode/EnterPinCode/EnterPinCodeViewModel.swift # Riot/Modules/SetPinCode/PinCodePreferences.swift # Riot/Modules/SetPinCode/SetPinCoordinator.swift # Riot/Modules/SetPinCode/SetPinCoordinatorBridgePresenter.swift # Riot/Modules/SetPinCode/SetupBiometrics/BiometricsAuthenticationPresenter.swift # Riot/Modules/SetPinCode/SetupBiometrics/SetupBiometricsCoordinator.swift # Riot/Modules/SetPinCode/SetupBiometrics/SetupBiometricsViewController.swift # Riot/Modules/SetPinCode/SetupBiometrics/SetupBiometricsViewModel.swift # Riot/Modules/Settings/DeactivateAccount/DeactivateAccountViewController.m # Riot/Modules/Settings/Security/ManageSession/ManageSessionViewController.m # Riot/Modules/Settings/Security/SecurityViewController.m # Riot/Modules/Settings/SettingsViewController.m # Riot/Modules/SideMenu/SideMenuCoordinator.swift # Riot/Modules/SideMenu/SideMenuViewModel.swift # Riot/Modules/Spaces/SpaceList/SpaceListViewModel.swift # Riot/Modules/Spaces/SpaceMenu/SpaceMenuPresenter.swift # Riot/Modules/Spaces/SpaceMenu/SpaceMenuViewModel.swift # Riot/Modules/Spaces/SpaceRoomList/ExploreRoomCoordinator.swift # Riot/Modules/SplitView/SplitViewCoordinator.swift # Riot/Modules/SplitView/SplitViewCoordinatorType.swift # Riot/Modules/StartChat/StartChatViewController.m # Riot/Modules/TabBar/MasterTabBarController.h # Riot/Modules/TabBar/MasterTabBarController.m # Riot/Modules/TabBar/TabBarCoordinator.swift # Riot/Modules/TabBar/TabBarCoordinatorType.swift # Riot/Modules/Threads/ThreadList/ThreadListViewModel.swift # Riot/SupportingFiles/Info.plist # Riot/SupportingFiles/Riot-Bridging-Header.h # Riot/SupportingFiles/Riot.entitlements # Riot/Utils/EventFormatter+DTCoreTextFix.m # Riot/Utils/EventFormatter.m # Riot/Utils/Tools.h # Riot/Utils/Tools.m # Riot/Utils/URLValidator.swift # Riot/Utils/UniversalLink.h # Riot/Utils/UniversalLink.m # Riot/target.yml # RiotNSE/NotificationService.swift # RiotNSE/RiotNSE.entitlements # RiotNSE/target.yml # RiotShareExtension/Shared/View/ShareViewController.m # RiotShareExtension/SupportingFiles/Info.plist # RiotShareExtension/target.yml # RiotSwiftUI/Modules/AnalyticsPrompt/AnalyticsPromptViewModel.swift # RiotSwiftUI/Modules/AnalyticsPrompt/Coordinator/AnalyticsPromptCoordinator.swift # RiotSwiftUI/Modules/AnalyticsPrompt/Coordinator/AnalyticsPromptStrings.swift # RiotSwiftUI/Modules/AnalyticsPrompt/MockAnalyticsPromptScreenState.swift # RiotSwiftUI/Modules/AnalyticsPrompt/Test/UI/AnalyticsPromptUITests.swift # RiotSwiftUI/Modules/AnalyticsPrompt/View/AnalyticsPrompt.swift # RiotSwiftUI/Modules/AnalyticsPrompt/View/AnalyticsPromptCheckmarkItem.swift # RiotSwiftUI/Modules/Authentication/Common/AuthenticationHomeserverViewData.swift # RiotSwiftUI/Modules/Authentication/Common/AuthenticationModels.swift # RiotSwiftUI/Modules/Authentication/Common/AuthenticationServerInfoSection.swift # RiotSwiftUI/Modules/Authentication/Common/Service/MatrixSDK/AuthenticationRestClient.swift # RiotSwiftUI/Modules/Authentication/Common/Service/MatrixSDK/AuthenticationService.swift # RiotSwiftUI/Modules/Authentication/Common/Service/MatrixSDK/AuthenticationState.swift # RiotSwiftUI/Modules/Authentication/Common/Service/MatrixSDK/LoginModels.swift # RiotSwiftUI/Modules/Authentication/Common/Service/MatrixSDK/LoginParameters.swift # RiotSwiftUI/Modules/Authentication/Common/Service/MatrixSDK/LoginWizard.swift # RiotSwiftUI/Modules/Authentication/Common/Service/MatrixSDK/RegistrationParameters.swift # RiotSwiftUI/Modules/Authentication/Common/Service/MatrixSDK/RegistrationWizard.swift # RiotSwiftUI/Modules/Authentication/Common/Service/MatrixSDK/SessionCreator.swift # RiotSwiftUI/Modules/Authentication/Common/Service/MatrixSDK/ThreePIDModels.swift # RiotSwiftUI/Modules/Authentication/Login/AuthenticationLoginModels.swift # RiotSwiftUI/Modules/Authentication/Login/Coordinator/AuthenticationLoginCoordinator.swift # RiotSwiftUI/Modules/Authentication/Login/Test/UI/AuthenticationLoginUITests.swift # RiotSwiftUI/Modules/Authentication/Login/Test/Unit/AuthenticationLoginViewModelTests.swift # RiotSwiftUI/Modules/Authentication/Login/View/AuthenticationLoginScreen.swift # RiotSwiftUI/Modules/Authentication/ReCaptcha/Test/UI/AuthenticationReCaptchaUITests.swift # RiotSwiftUI/Modules/Authentication/ReCaptcha/View/AuthenticationReCaptchaScreen.swift # RiotSwiftUI/Modules/Authentication/ReCaptcha/View/AuthenticationReCaptchaWebView.swift # RiotSwiftUI/Modules/Authentication/Registration/AuthenticationRegistrationModels.swift # RiotSwiftUI/Modules/Authentication/Registration/AuthenticationRegistrationViewModel.swift # RiotSwiftUI/Modules/Authentication/Registration/AuthenticationRegistrationViewModelProtocol.swift # RiotSwiftUI/Modules/Authentication/Registration/Coordinator/AuthenticationRegistrationCoordinator.swift # RiotSwiftUI/Modules/Authentication/Registration/MockAuthenticationRegistrationScreenState.swift # RiotSwiftUI/Modules/Authentication/Registration/Test/UI/AuthenticationRegistrationUITests.swift # RiotSwiftUI/Modules/Authentication/Registration/Test/Unit/AuthenticationRegistrationViewModelTests.swift # RiotSwiftUI/Modules/Authentication/Registration/View/AuthenticationRegistrationScreen.swift # RiotSwiftUI/Modules/Authentication/ServerSelection/AuthenticationServerSelectionModels.swift # RiotSwiftUI/Modules/Authentication/ServerSelection/AuthenticationServerSelectionViewModel.swift # RiotSwiftUI/Modules/Authentication/ServerSelection/Coordinator/AuthenticationServerSelectionCoordinator.swift # RiotSwiftUI/Modules/Authentication/ServerSelection/MockAuthenticationServerSelectionScreenState.swift # RiotSwiftUI/Modules/Authentication/ServerSelection/Test/UI/AuthenticationServerSelectionUITests.swift # RiotSwiftUI/Modules/Authentication/ServerSelection/Test/Unit/AuthenticationServerSelectionViewModelTests.swift # RiotSwiftUI/Modules/Authentication/ServerSelection/View/AuthenticationServerSelectionScreen.swift # RiotSwiftUI/Modules/Authentication/Terms/AuthenticationTermsModels.swift # RiotSwiftUI/Modules/Authentication/Terms/AuthenticationTermsViewModel.swift # RiotSwiftUI/Modules/Authentication/Terms/Coordinator/AuthenticationTermsCoordinator.swift # RiotSwiftUI/Modules/Authentication/Terms/MockAuthenticationTermsScreenState.swift # RiotSwiftUI/Modules/Authentication/Terms/Test/UI/AuthenticationTermsUITests.swift # RiotSwiftUI/Modules/Authentication/Terms/View/AuthenticationTermsScreen.swift # RiotSwiftUI/Modules/Authentication/Terms/View/AuthenticationTermsToggleStyle.swift # RiotSwiftUI/Modules/Authentication/VerifyEmail/AuthenticationVerifyEmailModels.swift # RiotSwiftUI/Modules/Authentication/VerifyEmail/AuthenticationVerifyEmailViewModel.swift # RiotSwiftUI/Modules/Authentication/VerifyEmail/Coordinator/AuthenticationVerifyEmailCoordinator.swift # RiotSwiftUI/Modules/Authentication/VerifyEmail/MockAuthenticationVerifyEmailScreenState.swift # RiotSwiftUI/Modules/Authentication/VerifyEmail/Test/UI/AuthenticationVerifyEmailUITests.swift # RiotSwiftUI/Modules/Authentication/VerifyEmail/Test/Unit/AuthenticationVerifyEmailViewModelTests.swift # RiotSwiftUI/Modules/Authentication/VerifyEmail/View/AuthenticationVerifyEmailForm.swift # RiotSwiftUI/Modules/Authentication/VerifyEmail/View/AuthenticationVerifyEmailScreen.swift # RiotSwiftUI/Modules/Authentication/VerifyMsisdn/AuthenticationVerifyMsisdnModels.swift # RiotSwiftUI/Modules/Authentication/VerifyMsisdn/AuthenticationVerifyMsisdnViewModel.swift # RiotSwiftUI/Modules/Authentication/VerifyMsisdn/Coordinator/AuthenticationVerifyMsisdnCoordinator.swift # RiotSwiftUI/Modules/Authentication/VerifyMsisdn/MockAuthenticationVerifyMsisdnScreenState.swift # RiotSwiftUI/Modules/Authentication/VerifyMsisdn/Test/UI/AuthenticationVerifyMsisdnUITests.swift # RiotSwiftUI/Modules/Authentication/VerifyMsisdn/Test/Unit/AuthenticationVerifyMsisdnViewModelTests.swift # RiotSwiftUI/Modules/Authentication/VerifyMsisdn/View/AuthenticationVerifyMsisdnForm.swift # RiotSwiftUI/Modules/Common/ActivityIndicator/ActivityIndicator.swift # RiotSwiftUI/Modules/Common/ActivityIndicator/ActivityIndicatorModifier.swift # RiotSwiftUI/Modules/Common/Avatar/Service/MatrixSDK/AvatarService.swift # RiotSwiftUI/Modules/Common/Avatar/Service/Mock/MockAvatarService.swift # RiotSwiftUI/Modules/Common/Avatar/View/AvatarImage.swift # RiotSwiftUI/Modules/Common/Avatar/View/PlaceholderAvatarImage.swift # RiotSwiftUI/Modules/Common/Avatar/View/SpaceAvatarImage.swift # RiotSwiftUI/Modules/Common/Avatar/ViewModel/AvatarServiceProtocol.swift # RiotSwiftUI/Modules/Common/Avatar/ViewModel/AvatarViewModel.swift # RiotSwiftUI/Modules/Common/Bridging/VectorContentView.swift # RiotSwiftUI/Modules/Common/DependencyInjection/DependencyContainerKey.swift # RiotSwiftUI/Modules/Common/EffectsScene/EffectsScene.swift # RiotSwiftUI/Modules/Common/EffectsScene/EffectsView.swift # RiotSwiftUI/Modules/Common/Extensions/Publisher.swift # RiotSwiftUI/Modules/Common/Mock/MockAppScreens.swift # RiotSwiftUI/Modules/Common/Mock/MockScreenState.swift # RiotSwiftUI/Modules/Common/Mock/ScreenList.swift # RiotSwiftUI/Modules/Common/Mock/ScreenStateInfo.swift # RiotSwiftUI/Modules/Common/Mock/StateRenderer.swift # RiotSwiftUI/Modules/Common/Test/UI/MockScreenTest.swift # RiotSwiftUI/Modules/Common/Test/UI/XCUIApplication+Riot.swift # RiotSwiftUI/Modules/Common/Test/XCTestPublisherExtensions.swift # RiotSwiftUI/Modules/Common/Theme/ThemeIdentifierExtensions.swift # RiotSwiftUI/Modules/Common/Theme/ThemeKey.swift # RiotSwiftUI/Modules/Common/Theme/ThemePublisher.swift # RiotSwiftUI/Modules/Common/Theme/ThemeSwiftUI.swift # RiotSwiftUI/Modules/Common/Theme/ThemeUsersColorsExtension.swift # RiotSwiftUI/Modules/Common/Theme/Themes/DarkThemeSwiftUI.swift # RiotSwiftUI/Modules/Common/Theme/Themes/DefaultThemeSwiftUI.swift # RiotSwiftUI/Modules/Common/Util/BorderModifier.swift # RiotSwiftUI/Modules/Common/Util/BorderedInputFieldStyle.swift # RiotSwiftUI/Modules/Common/Util/ClearViewModifier.swift # RiotSwiftUI/Modules/Common/Util/InlineTextButton.swift # RiotSwiftUI/Modules/Common/Util/MultilineTextField.swift # RiotSwiftUI/Modules/Common/Util/OptionButton.swift # RiotSwiftUI/Modules/Common/Util/PrimaryActionButtonStyle.swift # RiotSwiftUI/Modules/Common/Util/RadioButton.swift # RiotSwiftUI/Modules/Common/Util/RoundedBorderTextEditor.swift # RiotSwiftUI/Modules/Common/Util/RoundedBorderTextField.swift # RiotSwiftUI/Modules/Common/Util/RoundedCornerShape.swift # RiotSwiftUI/Modules/Common/Util/SafeBindingCollectionEnumerator.swift # RiotSwiftUI/Modules/Common/Util/ScreenTrackerViewModifier.swift # RiotSwiftUI/Modules/Common/Util/SearchBar.swift # RiotSwiftUI/Modules/Common/Util/SecondaryActionButtonStyle.swift # RiotSwiftUI/Modules/Common/Util/StyledText.swift # RiotSwiftUI/Modules/Common/Util/ThemableButton.swift # RiotSwiftUI/Modules/Common/Util/ThemableNavigationBar.swift # RiotSwiftUI/Modules/Common/Util/ThemableTextEditor.swift # RiotSwiftUI/Modules/Common/Util/ThemableTextField.swift # RiotSwiftUI/Modules/Common/Util/WaitOverlay.swift # RiotSwiftUI/Modules/Common/ViewFrameReader/FramePreferenceKey.swift # RiotSwiftUI/Modules/Common/ViewFrameReader/ViewFrameReader.swift # RiotSwiftUI/Modules/Common/ViewModel/StateStoreViewModel.swift # RiotSwiftUI/Modules/Onboarding/Avatar/Coordinator/OnboardingAvatarCoordinator.swift # RiotSwiftUI/Modules/Onboarding/Avatar/MockOnboardingAvatarScreenState.swift # RiotSwiftUI/Modules/Onboarding/Avatar/Test/UI/OnboardingAvatarUITests.swift # RiotSwiftUI/Modules/Onboarding/Avatar/Test/Unit/OnboardingAvatarViewModelTests.swift # RiotSwiftUI/Modules/Onboarding/Celebration/Test/UI/OnboardingCelebrationUITests.swift # RiotSwiftUI/Modules/Onboarding/Celebration/View/OnboardingCelebrationScreen.swift # RiotSwiftUI/Modules/Onboarding/Common/OnboardingIcon.swift # RiotSwiftUI/Modules/Onboarding/Common/OnboardingMetrics.swift # RiotSwiftUI/Modules/Onboarding/Congratulations/OnboardingCongratulationsModels.swift # RiotSwiftUI/Modules/Onboarding/Congratulations/Test/UI/OnboardingCongratulationsUITests.swift # RiotSwiftUI/Modules/Onboarding/Congratulations/View/OnboardingCongratulationsScreen.swift # RiotSwiftUI/Modules/Onboarding/DisplayName/Coordinator/OnboardingDisplayNameCoordinator.swift # RiotSwiftUI/Modules/Onboarding/DisplayName/Test/UI/OnboardingDisplayNameUITests.swift # RiotSwiftUI/Modules/Onboarding/DisplayName/View/OnboardingDisplayNameScreen.swift # RiotSwiftUI/Modules/Onboarding/SplashScreen/OnboardingSplashScreenModels.swift # RiotSwiftUI/Modules/Onboarding/SplashScreen/View/OnboardingSplashScreen.swift # RiotSwiftUI/Modules/Onboarding/SplashScreen/View/OnboardingSplashScreenPage.swift # RiotSwiftUI/Modules/Onboarding/SplashScreen/View/OnboardingSplashScreenPageIndicator.swift # RiotSwiftUI/Modules/Onboarding/UseCase/Coordinator/OnboardingUseCaseSelectionCoordinator.swift # RiotSwiftUI/Modules/Onboarding/UseCase/OnboardingUseCaseModels.swift # RiotSwiftUI/Modules/Onboarding/UseCase/Test/UI/OnboardingUseCaseUITests.swift # RiotSwiftUI/Modules/Onboarding/UseCase/View/OnboardingUseCaseSelectionScreen.swift # RiotSwiftUI/Modules/Room/LiveLocationSharingViewer/Coordinator/LiveLocationSharingViewerCoordinator.swift # RiotSwiftUI/Modules/Room/LiveLocationSharingViewer/LiveLocationSharingViewerModels.swift # RiotSwiftUI/Modules/Room/LiveLocationSharingViewer/LiveLocationSharingViewerViewModel.swift # RiotSwiftUI/Modules/Room/LiveLocationSharingViewer/LiveLocationSharingViewerViewModelProtocol.swift # RiotSwiftUI/Modules/Room/LiveLocationSharingViewer/MockLiveLocationSharingViewerScreenState.swift # RiotSwiftUI/Modules/Room/LiveLocationSharingViewer/Service/LiveLocationSharingViewerServiceProtocol.swift # RiotSwiftUI/Modules/Room/LiveLocationSharingViewer/Service/MatrixSDK/LiveLocationSharingViewerService.swift # RiotSwiftUI/Modules/Room/LiveLocationSharingViewer/Service/Mock/MockLiveLocationSharingViewerService.swift # RiotSwiftUI/Modules/Room/LiveLocationSharingViewer/Test/UI/LiveLocationSharingViewerUITests.swift # RiotSwiftUI/Modules/Room/LiveLocationSharingViewer/Test/Unit/LiveLocationSharingViewerViewModelTests.swift # RiotSwiftUI/Modules/Room/LiveLocationSharingViewer/View/LiveLocationListItem.swift # RiotSwiftUI/Modules/Room/LiveLocationSharingViewer/View/LiveLocationSharingViewer.swift # RiotSwiftUI/Modules/Room/LocationSharing/Coordinator/LocationSharingCoordinator.swift # RiotSwiftUI/Modules/Room/LocationSharing/LocationSharingModels.swift # RiotSwiftUI/Modules/Room/LocationSharing/LocationSharingScreenState.swift # RiotSwiftUI/Modules/Room/LocationSharing/LocationSharingViewModel.swift # RiotSwiftUI/Modules/Room/LocationSharing/Service/MatrixSDK/LocationSharingService.swift # RiotSwiftUI/Modules/Room/LocationSharing/Service/Mock/MockLocationSharingService.swift # RiotSwiftUI/Modules/Room/LocationSharing/Test/UI/LocationSharingUITests.swift # RiotSwiftUI/Modules/Room/LocationSharing/Test/Unit/LocationSharingViewModelTests.swift # RiotSwiftUI/Modules/Room/LocationSharing/View/LocationSharingMapView.swift # RiotSwiftUI/Modules/Room/LocationSharing/View/LocationSharingMarkerView.swift # RiotSwiftUI/Modules/Room/LocationSharing/View/LocationSharingOptionButton.swift # RiotSwiftUI/Modules/Room/LocationSharing/View/LocationSharingView.swift # RiotSwiftUI/Modules/Room/LocationSharing/View/MapCreditsView.swift # RiotSwiftUI/Modules/Room/LocationSharing/View/UserLocationAnnotationView.swift # RiotSwiftUI/Modules/Room/NotificationSettings/Coordinator/RoomNotificationSettingsCoordinator.swift # RiotSwiftUI/Modules/Room/NotificationSettings/View/FormItemButtonStyle.swift # RiotSwiftUI/Modules/Room/NotificationSettings/View/FormPickerItem.swift # RiotSwiftUI/Modules/Room/NotificationSettings/View/FormSectionFooter.swift # RiotSwiftUI/Modules/Room/NotificationSettings/View/FormSectionHeader.swift # RiotSwiftUI/Modules/Room/NotificationSettings/View/RoomNotificationSettings.swift # RiotSwiftUI/Modules/Room/NotificationSettings/View/RoomNotificationSettingsHeader.swift # RiotSwiftUI/Modules/Room/NotificationSettings/View/VectorForm.swift # RiotSwiftUI/Modules/Room/NotificationSettings/ViewModel/RoomNotificationSettingsSwiftUIViewModel.swift # RiotSwiftUI/Modules/Room/PollEditForm/Coordinator/PollEditFormCoordinator.swift # RiotSwiftUI/Modules/Room/PollEditForm/PollEditFormScreenState.swift # RiotSwiftUI/Modules/Room/PollEditForm/PollEditFormViewModel.swift # RiotSwiftUI/Modules/Room/PollEditForm/Test/UI/PollEditFormUITests.swift # RiotSwiftUI/Modules/Room/PollEditForm/Test/Unit/PollEditFormViewModelTests.swift # RiotSwiftUI/Modules/Room/PollEditForm/View/PollEditForm.swift # RiotSwiftUI/Modules/Room/PollEditForm/View/PollEditFormAnswerOptionView.swift # RiotSwiftUI/Modules/Room/PollEditForm/View/PollEditFormTypePicker.swift # RiotSwiftUI/Modules/Room/RoomAccess/Coordinator/RoomAccessCoordinator.swift # RiotSwiftUI/Modules/Room/RoomAccess/Coordinator/RoomAccessCoordinatorBridgePresenter.swift # RiotSwiftUI/Modules/Room/RoomAccess/RoomAccessTypeChooser/Coordinator/RoomAccessTypeChooserCoordinator.swift # RiotSwiftUI/Modules/Room/RoomAccess/RoomAccessTypeChooser/MockRoomAccessTypeChooserScreenState.swift # RiotSwiftUI/Modules/Room/RoomAccess/RoomAccessTypeChooser/RoomAccessTypeChooserViewModel.swift # RiotSwiftUI/Modules/Room/RoomAccess/RoomAccessTypeChooser/RoomAccessTypeChooserViewModelProtocol.swift # RiotSwiftUI/Modules/Room/RoomAccess/RoomAccessTypeChooser/Service/MatrixSDK/RoomAccessTypeChooserService.swift # RiotSwiftUI/Modules/Room/RoomAccess/RoomAccessTypeChooser/Service/Mock/MockRoomAccessTypeChooserService.swift # RiotSwiftUI/Modules/Room/RoomAccess/RoomAccessTypeChooser/Service/RoomAccessTypeChooserServiceProtocol.swift # RiotSwiftUI/Modules/Room/RoomAccess/RoomAccessTypeChooser/Test/UI/RoomAccessTypeChooserUITests.swift # RiotSwiftUI/Modules/Room/RoomAccess/RoomAccessTypeChooser/Test/Unit/RoomAccessTypeChooserViewModelTests.swift # RiotSwiftUI/Modules/Room/RoomAccess/RoomAccessTypeChooser/View/RoomAccessTypeChooser.swift # RiotSwiftUI/Modules/Room/RoomAccess/RoomAccessTypeChooser/View/RoomAccessTypeChooserRow.swift # RiotSwiftUI/Modules/Room/RoomAccess/RoomRestrictedAccessSpaceChooser/Coordinator/RoomRestrictedAccessSpaceChooserViewProvider.swift # RiotSwiftUI/Modules/Room/RoomAccess/RoomRestrictedAccessSpaceChooser/View/RoomRestrictedAccessSpaceChooserSelector.swift # RiotSwiftUI/Modules/Room/RoomSuggestion/Coordinator/RoomSuggestionCoordinator.swift # RiotSwiftUI/Modules/Room/RoomSuggestion/Coordinator/RoomSuggestionCoordinatorBridgePresenter.swift # RiotSwiftUI/Modules/Room/RoomSuggestion/RoomSuggestionSpaceChooser/Coordinator/RoomSuggestionSpaceChooserViewProvider.swift # RiotSwiftUI/Modules/Room/RoomSuggestion/RoomSuggestionSpaceChooser/View/RoomSuggestionSpaceChooserSelector.swift # RiotSwiftUI/Modules/Room/RoomUpgrade/Coordinator/RoomUpgradeCoordinator.swift # RiotSwiftUI/Modules/Room/RoomUpgrade/MockRoomUpgradeScreenState.swift # RiotSwiftUI/Modules/Room/RoomUpgrade/RoomUpgradeViewModel.swift # RiotSwiftUI/Modules/Room/RoomUpgrade/RoomUpgradeViewModelProtocol.swift # RiotSwiftUI/Modules/Room/RoomUpgrade/Service/MatrixSDK/RoomUpgradeService.swift # RiotSwiftUI/Modules/Room/RoomUpgrade/Service/Mock/MockRoomUpgradeService.swift # RiotSwiftUI/Modules/Room/RoomUpgrade/Service/RoomUpgradeServiceProtocol.swift # RiotSwiftUI/Modules/Room/RoomUpgrade/Test/UI/RoomUpgradeUITests.swift # RiotSwiftUI/Modules/Room/RoomUpgrade/Test/Unit/RoomUpgradeViewModelTests.swift # RiotSwiftUI/Modules/Room/RoomUpgrade/View/RoomUpgrade.swift # RiotSwiftUI/Modules/Room/StaticLocationSharingViewer/Coordinator/StaticLocationViewingCoordinator.swift # RiotSwiftUI/Modules/Room/StaticLocationSharingViewer/MockStaticLocationViewingScreenState.swift # RiotSwiftUI/Modules/Room/StaticLocationSharingViewer/StaticLocationViewingModels.swift # RiotSwiftUI/Modules/Room/StaticLocationSharingViewer/StaticLocationViewingViewModel.swift # RiotSwiftUI/Modules/Room/StaticLocationSharingViewer/StaticLocationViewingViewModelProtocol.swift # RiotSwiftUI/Modules/Room/StaticLocationSharingViewer/Test/UI/StaticLocationViewingUITests.swift # RiotSwiftUI/Modules/Room/StaticLocationSharingViewer/Test/Unit/StaticLocationViewingViewModelTests.swift # RiotSwiftUI/Modules/Room/StaticLocationSharingViewer/View/StaticLocationView.swift # RiotSwiftUI/Modules/Room/TimelinePoll/Coordinator/TimelinePollCoordinator.swift # RiotSwiftUI/Modules/Room/TimelinePoll/Coordinator/TimelinePollProvider.swift # RiotSwiftUI/Modules/Room/TimelinePoll/Test/UI/TimelinePollUITests.swift # RiotSwiftUI/Modules/Room/TimelinePoll/Test/Unit/TimelinePollViewModelTests.swift # RiotSwiftUI/Modules/Room/TimelinePoll/TimelinePollScreenState.swift # RiotSwiftUI/Modules/Room/TimelinePoll/TimelinePollViewModel.swift # RiotSwiftUI/Modules/Room/TimelinePoll/TimelinePollViewModelProtocol.swift # RiotSwiftUI/Modules/Room/TimelinePoll/View/TimelinePollAnswerOptionButton.swift # RiotSwiftUI/Modules/Room/TimelinePoll/View/TimelinePollView.swift # RiotSwiftUI/Modules/Room/UserSuggestion/Coordinator/UserSuggestionCoordinator.swift # RiotSwiftUI/Modules/Room/UserSuggestion/Coordinator/UserSuggestionCoordinatorBridge.swift # RiotSwiftUI/Modules/Room/UserSuggestion/Service/UserSuggestionService.swift # RiotSwiftUI/Modules/Room/UserSuggestion/Service/UserSuggestionServiceProtocol.swift # RiotSwiftUI/Modules/Room/UserSuggestion/Test/UI/UserSuggestionUITests.swift # RiotSwiftUI/Modules/Room/UserSuggestion/Test/Unit/UserSuggestionServiceTests.swift # RiotSwiftUI/Modules/Room/UserSuggestion/UserSuggestionScreenState.swift # RiotSwiftUI/Modules/Room/UserSuggestion/UserSuggestionViewModel.swift # RiotSwiftUI/Modules/Room/UserSuggestion/View/UserSuggestionList.swift # RiotSwiftUI/Modules/Room/UserSuggestion/View/UserSuggestionListItem.swift # RiotSwiftUI/Modules/Room/UserSuggestion/View/UserSuggestionListWithInput.swift # RiotSwiftUI/Modules/Settings/Notifications/Coordinator/NotificationSettingsBridgePresenter.swift # RiotSwiftUI/Modules/Settings/Notifications/Coordinator/NotificationSettingsCoordinator.swift # RiotSwiftUI/Modules/Settings/Notifications/Model/NotificationSettingsScreen.swift # RiotSwiftUI/Modules/Settings/Notifications/Service/MatrixSDK/MXNotificationSettingsService.swift # RiotSwiftUI/Modules/Settings/Notifications/Service/Mock/MockNotificationSettingsService.swift # RiotSwiftUI/Modules/Settings/Notifications/Service/NotificationSettingsServiceType.swift # RiotSwiftUI/Modules/Settings/Notifications/View/Chip.swift # RiotSwiftUI/Modules/Settings/Notifications/View/Chips.swift # RiotSwiftUI/Modules/Settings/Notifications/View/ChipsInput.swift # RiotSwiftUI/Modules/Settings/Notifications/View/DefaultNotificationSettings.swift # RiotSwiftUI/Modules/Settings/Notifications/View/FormInputFieldStyle.swift # RiotSwiftUI/Modules/Settings/Notifications/View/MentionsAndKeywordNotificationSettings.swift # RiotSwiftUI/Modules/Settings/Notifications/View/NotificationSettings.swift # RiotSwiftUI/Modules/Settings/Notifications/View/NotificationSettingsKeywords.swift # RiotSwiftUI/Modules/Settings/Notifications/View/OtherNotificationSettings.swift # RiotSwiftUI/Modules/Settings/Notifications/ViewModel/NotificationSettingsViewModel.swift # RiotSwiftUI/Modules/Spaces/AddRoomSelector/Coordinator/AddRoomSelectorViewProvider.swift # RiotSwiftUI/Modules/Spaces/AddRoomSelector/View/AddRoomSelector.swift # RiotSwiftUI/Modules/Spaces/LeaveSpace/Coordinator/LeaveSpaceViewProvider.swift # RiotSwiftUI/Modules/Spaces/LeaveSpace/View/LeaveSpace.swift # RiotSwiftUI/Modules/Spaces/MatrixItemChooser/Coordinator/MatrixItemChooserCoordinator.swift # RiotSwiftUI/Modules/Spaces/MatrixItemChooser/MatrixItemChooserViewModel.swift # RiotSwiftUI/Modules/Spaces/MatrixItemChooser/MatrixItemChooserViewModelProtocol.swift # RiotSwiftUI/Modules/Spaces/MatrixItemChooser/MockMatrixItemChooserScreenState.swift # RiotSwiftUI/Modules/Spaces/MatrixItemChooser/Service/MatrixItemChooserServiceProtocol.swift # RiotSwiftUI/Modules/Spaces/MatrixItemChooser/Service/MatrixSDK/MatrixItemChooserService.swift # RiotSwiftUI/Modules/Spaces/MatrixItemChooser/Service/Mock/MockMatrixItemChooserService.swift # RiotSwiftUI/Modules/Spaces/MatrixItemChooser/Test/UI/MatrixItemChooserUITests.swift # RiotSwiftUI/Modules/Spaces/MatrixItemChooser/Test/Unit/MatrixItemChooserViewModelTests.swift # RiotSwiftUI/Modules/Spaces/MatrixItemChooser/View/MatrixItemChooser.swift # RiotSwiftUI/Modules/Spaces/MatrixItemChooser/View/MatrixItemChooserListRow.swift # RiotSwiftUI/Modules/Spaces/MatrixItemChooser/View/MatrixItemChooserSectionHeader.swift # RiotSwiftUI/Modules/Spaces/RoomAncestorSelector/Coordinator/RoomAncestorSelectorViewProvider.swift # RiotSwiftUI/Modules/Spaces/RoomAncestorSelector/View/RoomAncestorSelector.swift # RiotSwiftUI/Modules/Spaces/SpaceCreation/Coordinator/SpaceCreationCoordinator.swift # RiotSwiftUI/Modules/Spaces/SpaceCreation/SpaceCreationEmailInvites/Coordinator/SpaceCreationEmailInvitesCoordinator.swift # RiotSwiftUI/Modules/Spaces/SpaceCreation/SpaceCreationEmailInvites/Service/MatrixSDK/SpaceCreationEmailInvitesService.swift # RiotSwiftUI/Modules/Spaces/SpaceCreation/SpaceCreationEmailInvites/Service/Mock/MockSpaceCreationEmailInvitesScreenState.swift # RiotSwiftUI/Modules/Spaces/SpaceCreation/SpaceCreationEmailInvites/Service/Mock/MockSpaceCreationEmailInvitesService.swift # RiotSwiftUI/Modules/Spaces/SpaceCreation/SpaceCreationEmailInvites/Service/SpaceCreationEmailInvitesServiceProtocol.swift # RiotSwiftUI/Modules/Spaces/SpaceCreation/SpaceCreationEmailInvites/Test/UI/SpaceCreationEmailInvitesUITests.swift # RiotSwiftUI/Modules/Spaces/SpaceCreation/SpaceCreationEmailInvites/Test/Unit/SpaceCreationEmailInvitesViewModelTests.swift # RiotSwiftUI/Modules/Spaces/SpaceCreation/SpaceCreationEmailInvites/View/SpaceCreationEmailInvites.swift # RiotSwiftUI/Modules/Spaces/SpaceCreation/SpaceCreationEmailInvites/ViewModel/SpaceCreationEmailInvitesViewModel.swift # RiotSwiftUI/Modules/Spaces/SpaceCreation/SpaceCreationEmailInvites/ViewModel/SpaceCreationEmailInvitesViewModelProtocol.swift # RiotSwiftUI/Modules/Spaces/SpaceCreation/SpaceCreationMatrixItemChooser/Coordinator/SpaceCreationMatrixItemChooserViewProvider.swift # RiotSwiftUI/Modules/Spaces/SpaceCreation/SpaceCreationMatrixItemChooser/View/SpaceCreationMatrixItemChooser.swift # RiotSwiftUI/Modules/Spaces/SpaceCreation/SpaceCreationMenu/Coordinator/SpaceCreationMenuCoordinator.swift # RiotSwiftUI/Modules/Spaces/SpaceCreation/SpaceCreationMenu/Test/UI/SpaceCreationMenuUITests.swift # RiotSwiftUI/Modules/Spaces/SpaceCreation/SpaceCreationMenu/Test/Unit/SpaceCreationMenuViewModelTests.swift # RiotSwiftUI/Modules/Spaces/SpaceCreation/SpaceCreationMenu/View/SpaceCreationMenu.swift # RiotSwiftUI/Modules/Spaces/SpaceCreation/SpaceCreationMenu/ViewModel/SpaceCreationMenuViewModel.swift # RiotSwiftUI/Modules/Spaces/SpaceCreation/SpaceCreationMenu/ViewModel/SpaceCreationMenuViewModelProtocol.swift # RiotSwiftUI/Modules/Spaces/SpaceCreation/SpaceCreationPostProcess/Coordinator/SpaceCreationPostProcessCoordinator.swift # RiotSwiftUI/Modules/Spaces/SpaceCreation/SpaceCreationPostProcess/Service/MatrixSDK/SpaceCreationPostProcessService.swift # RiotSwiftUI/Modules/Spaces/SpaceCreation/SpaceCreationPostProcess/Service/Mock/MockSpaceCreationPostProcessScreenState.swift # RiotSwiftUI/Modules/Spaces/SpaceCreation/SpaceCreationPostProcess/Service/Mock/MockSpaceCreationPostProcessService.swift # RiotSwiftUI/Modules/Spaces/SpaceCreation/SpaceCreationPostProcess/Service/SpaceCreationPostProcessServiceProtocol.swift # RiotSwiftUI/Modules/Spaces/SpaceCreation/SpaceCreationPostProcess/Test/UI/SpaceCreationPostProcessUITests.swift # RiotSwiftUI/Modules/Spaces/SpaceCreation/SpaceCreationPostProcess/Test/Unit/SpaceCreationPostProcessViewModelTests.swift # RiotSwiftUI/Modules/Spaces/SpaceCreation/SpaceCreationPostProcess/View/SpaceCreationPostProcess.swift # RiotSwiftUI/Modules/Spaces/SpaceCreation/SpaceCreationPostProcess/View/SpaceCreationPostProcessItem.swift # RiotSwiftUI/Modules/Spaces/SpaceCreation/SpaceCreationPostProcess/ViewModel/SpaceCreationPostProcessViewModel.swift # RiotSwiftUI/Modules/Spaces/SpaceCreation/SpaceCreationPostProcess/ViewModel/SpaceCreationPostProcessViewModelProtocol.swift # RiotSwiftUI/Modules/Spaces/SpaceCreation/SpaceCreationRooms/Coordinator/SpaceCreationRoomsCoordinator.swift # RiotSwiftUI/Modules/Spaces/SpaceCreation/SpaceCreationRooms/Service/Mock/MockSpaceCreationRoomsScreenState.swift # RiotSwiftUI/Modules/Spaces/SpaceCreation/SpaceCreationRooms/Test/UI/SpaceCreationRoomsUITests.swift # RiotSwiftUI/Modules/Spaces/SpaceCreation/SpaceCreationRooms/Test/Unit/SpaceCreationRoomsViewModelTests.swift # RiotSwiftUI/Modules/Spaces/SpaceCreation/SpaceCreationRooms/View/SpaceCreationRooms.swift # RiotSwiftUI/Modules/Spaces/SpaceCreation/SpaceCreationRooms/ViewModel/SpaceCreationRoomsViewModel.swift # RiotSwiftUI/Modules/Spaces/SpaceCreation/SpaceCreationRooms/ViewModel/SpaceCreationRoomsViewModelProtocol.swift # RiotSwiftUI/Modules/Spaces/SpaceCreation/SpaceCreationSettings/Coordinator/SpaceCreationSettingsCoordinator.swift # RiotSwiftUI/Modules/Spaces/SpaceCreation/SpaceCreationSettings/Service/MatrixSDK/SpaceCreationSettingsService.swift # RiotSwiftUI/Modules/Spaces/SpaceCreation/SpaceCreationSettings/Service/Mock/MockSpaceCreationSettingsScreenState.swift # RiotSwiftUI/Modules/Spaces/SpaceCreation/SpaceCreationSettings/Service/Mock/MockSpaceCreationSettingsService.swift # RiotSwiftUI/Modules/Spaces/SpaceCreation/SpaceCreationSettings/Service/SpaceCreationSettingsServiceProtocol.swift # RiotSwiftUI/Modules/Spaces/SpaceCreation/SpaceCreationSettings/Test/UI/SpaceCreationSettingsUITests.swift # RiotSwiftUI/Modules/Spaces/SpaceCreation/SpaceCreationSettings/Test/Unit/SpaceCreationSettingsViewModelTests.swift # RiotSwiftUI/Modules/Spaces/SpaceCreation/SpaceCreationSettings/View/SpaceCreationSettings.swift # RiotSwiftUI/Modules/Spaces/SpaceCreation/SpaceCreationSettings/ViewModel/SpaceCreationSettingsViewModel.swift # RiotSwiftUI/Modules/Spaces/SpaceSettings/Coordinator/SpaceSettingsModalCoordinator.swift # RiotSwiftUI/Modules/Spaces/SpaceSettings/Coordinator/SpaceSettingsModalCoordinatorBridgePresenter.swift # RiotSwiftUI/Modules/Spaces/SpaceSettings/SpaceSettings/Coordinator/SpaceSettingsCoordinator.swift # RiotSwiftUI/Modules/Spaces/SpaceSettings/SpaceSettings/MockSpaceSettingsScreenState.swift # RiotSwiftUI/Modules/Spaces/SpaceSettings/SpaceSettings/Service/MatrixSDK/SpaceSettingsService.swift # RiotSwiftUI/Modules/Spaces/SpaceSettings/SpaceSettings/Service/Mock/MockSpaceSettingsService.swift # RiotSwiftUI/Modules/Spaces/SpaceSettings/SpaceSettings/Service/SpaceSettingsServiceProtocol.swift # RiotSwiftUI/Modules/Spaces/SpaceSettings/SpaceSettings/SpaceSettingsViewModel.swift # RiotSwiftUI/Modules/Spaces/SpaceSettings/SpaceSettings/SpaceSettingsViewModelProtocol.swift # RiotSwiftUI/Modules/Spaces/SpaceSettings/SpaceSettings/Test/UI/SpaceSettingsUITests.swift # RiotSwiftUI/Modules/Spaces/SpaceSettings/SpaceSettings/Test/Unit/SpaceSettingsViewModelTests.swift # RiotSwiftUI/Modules/Spaces/SpaceSettings/SpaceSettings/View/SpaceSettings.swift # RiotSwiftUI/Modules/Spaces/SpaceSettings/SpaceSettings/View/SpaceSettingsOptionListItem.swift # RiotSwiftUI/Modules/Template/SimpleScreenExample/Test/UI/TemplateSimpleScreenUITests.swift # RiotSwiftUI/Modules/Template/SimpleUserProfileExample/Test/UI/TemplateUserProfileUITests.swift # RiotSwiftUI/Modules/Template/TemplateAdvancedRoomsExample/TemplateRoomChat/Test/UI/TemplateRoomChatUITests.swift # RiotSwiftUI/Modules/Template/TemplateAdvancedRoomsExample/TemplateRoomList/Test/UI/TemplateRoomListUITests.swift # RiotSwiftUI/RiotSwiftUIApp.swift # RiotSwiftUI/target.yml # RiotSwiftUI/targetUITests.yml # RiotTests/MatrixKitTests/MXKEventFormatter+Tests.h # RiotTests/MatrixKitTests/MXKEventFormatterTests.m # RiotTests/MatrixKitTests/MXKRoomDataSourceTests.swift # RiotTests/MatrixKitTests/MatrixKitTests-Bridging-Header.h # RiotTests/Modules/Authentication/AuthenticationServiceTests.swift # RiotTests/OnboardingTests.swift # RiotTests/PillsFormatterTests.swift # RiotTests/target.yml # SiriIntents/IntentHandler.m # SiriIntents/target.yml # Tools/SwiftGen/swiftgen-config.yml # Tools/Templates/buildable/SimpleScreenTemplate/SimpleScreenTemplateViewController.storyboard # fastlane/.env.default # fastlane/Fastfile # project.yml
1937 lines
75 KiB
Objective-C
1937 lines
75 KiB
Objective-C
/*
|
|
Copyright 2015 OpenMarket Ltd
|
|
Copyright 2017 Vector Creations Ltd
|
|
Copyright 2019 New Vector Ltd
|
|
Copyright (c) 2021 BWI GmbH
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
you may not use this file except in compliance with the License.
|
|
You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
See the License for the specific language governing permissions and
|
|
limitations under the License.
|
|
*/
|
|
|
|
#import "AuthenticationViewController.h"
|
|
|
|
#import "MXSession+Riot.h"
|
|
|
|
#import "AuthInputsView.h"
|
|
#import "ForgotPasswordInputsView.h"
|
|
#import "AuthFallBackViewController.h"
|
|
|
|
#import "GeneratedInterface-Swift.h"
|
|
|
|
static const CGFloat kAuthInputContainerViewMinHeightConstraintConstant = 150.0;
|
|
|
|
@interface AuthenticationViewController () <AuthFallBackViewControllerDelegate, SetPinCoordinatorBridgePresenterDelegate,
|
|
SocialLoginListViewDelegate,
|
|
SSOAuthenticationPresenterDelegate
|
|
>
|
|
{
|
|
/**
|
|
The default country code used to initialize the mobile phone number input.
|
|
*/
|
|
NSString *defaultCountryCode;
|
|
|
|
/**
|
|
Observe kThemeServiceDidChangeThemeNotification to handle user interface theme change.
|
|
*/
|
|
id kThemeServiceDidChangeThemeNotificationObserver;
|
|
|
|
/**
|
|
Observe AppDelegateUniversalLinkDidChangeNotification to handle universal link changes.
|
|
*/
|
|
id universalLinkDidChangeNotificationObserver;
|
|
|
|
/**
|
|
Server discovery.
|
|
*/
|
|
MXAutoDiscovery *autoDiscovery;
|
|
|
|
AuthFallBackViewController *authFallBackViewController;
|
|
|
|
// successful login credentials
|
|
MXCredentials *loginCredentials;
|
|
|
|
// Check false display of this screen only once
|
|
BOOL didCheckFalseAuthScreenDisplay;
|
|
}
|
|
|
|
@property (nonatomic, readonly) BOOL isIdentityServerConfigured;
|
|
@property (nonatomic, strong) SetPinCoordinatorBridgePresenter *setPinCoordinatorBridgePresenter;
|
|
@property (nonatomic, strong) KeyboardAvoider *keyboardAvoider;
|
|
|
|
@property (weak, nonatomic) IBOutlet UIView *socialLoginContainerView;
|
|
@property (nonatomic, weak) SocialLoginListView *socialLoginListView;
|
|
|
|
@property (nonatomic, strong) SSOAuthenticationPresenter *ssoAuthenticationPresenter;
|
|
|
|
// Current SSO flow containing Identity Providers. Used for `socialLoginListView`
|
|
@property (nonatomic, strong) MXLoginSSOFlow *currentLoginSSOFlow;
|
|
|
|
// Current SSO transaction id used to identify and validate the SSO authentication callback
|
|
@property (nonatomic, strong) NSString *ssoCallbackTxnId;
|
|
/**
|
|
The SSO provider that was used to successfully complete login, otherwise `nil`.
|
|
*/
|
|
@property (nonatomic, readwrite, nullable) SSOIdentityProvider *ssoIdentityProvider;
|
|
|
|
@property (nonatomic, getter = isFirstViewAppearing) BOOL firstViewAppearing;
|
|
|
|
@property (nonatomic, strong) UISwitch *bwServerOptionsSwitch;
|
|
@property (nonatomic, strong) UILabel *bwServerOptionsLabel;
|
|
@property (nonatomic, strong) UISegmentedControl *bwServerOptionsControl;
|
|
|
|
@property (nonatomic, strong) UIButton *bwServerPreSelectionButton;
|
|
|
|
@property (nonatomic, strong) UIButton *bwRegisterButton;
|
|
|
|
@property (nonatomic, strong) MXKErrorAlertPresentation *errorPresenter;
|
|
|
|
@end
|
|
|
|
@implementation AuthenticationViewController
|
|
|
|
+ (UINib *)nib
|
|
{
|
|
return [UINib nibWithNibName:NSStringFromClass(self)
|
|
bundle:[NSBundle bundleForClass:self]];
|
|
}
|
|
|
|
+ (instancetype)authenticationViewController
|
|
{
|
|
return [[[self class] alloc] initWithNibName:NSStringFromClass(self)
|
|
bundle:[NSBundle bundleForClass:self]];
|
|
}
|
|
|
|
#pragma mark -
|
|
|
|
- (void)finalizeInit
|
|
{
|
|
[super finalizeInit];
|
|
|
|
// Setup `MXKViewControllerHandling` properties
|
|
self.enableBarTintColorStatusChange = NO;
|
|
self.rageShakeManager = [RageShakeManager sharedManager];
|
|
|
|
// Set a default country code
|
|
// Note: this value is used only when no MCC and no local country code is available.
|
|
defaultCountryCode = @"GB";
|
|
|
|
didCheckFalseAuthScreenDisplay = NO;
|
|
|
|
_firstViewAppearing = YES;
|
|
|
|
self.errorPresenter = [MXKErrorAlertPresentation new];
|
|
}
|
|
|
|
- (void)viewDidLoad
|
|
{
|
|
/*
|
|
* An alert message will be displayed when a Man in the middle is detected.
|
|
*/
|
|
[self displayCouldNotVerifyIdentityOfRemoteServer];
|
|
|
|
[super viewDidLoad];
|
|
|
|
self.navigationItem.title = nil;
|
|
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:VectorL10n.authRegister
|
|
style:UIBarButtonItemStylePlain
|
|
target:self
|
|
action:@selector(onButtonPressed:)];
|
|
|
|
AppConfigService *service = AppConfigService.shared;
|
|
|
|
self.defaultHomeServerUrl = service.serverUrl;
|
|
self.defaultIdentityServerUrl = service.serverUrl;
|
|
|
|
self.welcomeImageView.image = AssetSharedImages.horizontalLogo.image;
|
|
|
|
[self.submitButton.layer setCornerRadius:5];
|
|
self.submitButton.clipsToBounds = YES;
|
|
[self.submitButton setTitle:[VectorL10n authLogin] forState:UIControlStateNormal];
|
|
[self.submitButton setTitle:[VectorL10n authLogin] forState:UIControlStateHighlighted];
|
|
self.submitButton.enabled = YES;
|
|
|
|
[self.skipButton.layer setCornerRadius:5];
|
|
self.skipButton.clipsToBounds = YES;
|
|
[self.skipButton setTitle:[VectorL10n authSkip] forState:UIControlStateNormal];
|
|
[self.skipButton setTitle:[VectorL10n authSkip] forState:UIControlStateHighlighted];
|
|
self.skipButton.enabled = YES;
|
|
|
|
[self.customServersTickButton setImage:AssetImages.selectionUntick.image forState:UIControlStateNormal];
|
|
[self.customServersTickButton setImage:AssetImages.selectionUntick.image forState:UIControlStateHighlighted];
|
|
|
|
if (!BuildSettings.authScreenShowRegister)
|
|
{
|
|
self.navigationItem.rightBarButtonItem.enabled = NO;
|
|
self.navigationItem.rightBarButtonItem.title = nil;
|
|
}
|
|
self.serverOptionsContainer.hidden = !BuildSettings.authScreenShowCustomServerOptions;
|
|
|
|
[self setCustomServerFieldsVisible:NO];
|
|
|
|
if( BuildSettings.authScreenShowTestServerOptions ) {
|
|
[self enableTestServerControl];
|
|
}
|
|
|
|
if( BuildSettings.bwiEnableRegisterInfo ) {
|
|
[self enableRegisterButton];
|
|
}
|
|
|
|
// Soft logout section
|
|
self.softLogoutClearDataButton.layer.cornerRadius = 5;
|
|
self.softLogoutClearDataButton.clipsToBounds = YES;
|
|
[self.softLogoutClearDataButton setTitle:[VectorL10n authSoftlogoutClearDataButton] forState:UIControlStateNormal];
|
|
[self.softLogoutClearDataButton setTitle:[VectorL10n authSoftlogoutClearDataButton] forState:UIControlStateHighlighted];
|
|
self.softLogoutClearDataButton.enabled = YES;
|
|
self.softLogoutClearDataContainer.hidden = YES;
|
|
|
|
// The view controller dismiss itself on successful login.
|
|
self.delegate = self;
|
|
|
|
self.homeServerTextField.placeholder = [VectorL10n authHomeServerPlaceholder];
|
|
self.identityServerTextField.placeholder = [VectorL10n authIdentityServerPlaceholder];
|
|
|
|
// Headline and subheadlineIntroLabel
|
|
self.headlineIntroLabel.text = NSLocalizedStringFromTable(@"auth_login_headline_text", @"Vector", nil);
|
|
self.subheadlineIntroLabel.text = NSLocalizedStringFromTable(@"auth_login_subheadline_text", @"Vector", nil);
|
|
|
|
self.authenticationActivityIndicatorContainerView.layer.cornerRadius = 5;
|
|
[self.authenticationActivityIndicator addObserver:self
|
|
forKeyPath:@"hidden"
|
|
options:0
|
|
context:nil];
|
|
|
|
// Custom used authInputsView
|
|
[self registerAuthInputsViewClass:AuthInputsView.class forAuthType:MXKAuthenticationTypeLogin];
|
|
[self registerAuthInputsViewClass:AuthInputsView.class forAuthType:MXKAuthenticationTypeRegister];
|
|
[self registerAuthInputsViewClass:ForgotPasswordInputsView.class forAuthType:MXKAuthenticationTypeForgotPassword];
|
|
|
|
// Initialize the auth inputs display
|
|
AuthInputsView *authInputsView = [AuthInputsView authInputsView];
|
|
MXAuthenticationSession *authSession = [MXAuthenticationSession modelFromJSON:@{@"flows":@[@{@"stages":@[kMXLoginFlowTypePassword]}]}];
|
|
[authInputsView setAuthSession:authSession withAuthType:MXKAuthenticationTypeLogin];
|
|
self.authInputsView = authInputsView;
|
|
|
|
[self setupPasswordIndicator: authInputsView];
|
|
|
|
// Listen to action within the child view
|
|
[authInputsView.ssoButton addTarget:self action:@selector(onButtonPressed:) forControlEvents:UIControlEventTouchUpInside];
|
|
|
|
// Observe user interface theme change.
|
|
kThemeServiceDidChangeThemeNotificationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:kThemeServiceDidChangeThemeNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notif) {
|
|
|
|
[self userInterfaceThemeDidChange];
|
|
|
|
}];
|
|
universalLinkDidChangeNotificationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:AppDelegateUniversalLinkDidChangeNotification object:nil queue:nil usingBlock:^(NSNotification * _Nonnull notification) {
|
|
[self updateUniversalLink];
|
|
}];
|
|
|
|
[self userInterfaceThemeDidChange];
|
|
[self updateUniversalLink];
|
|
|
|
[self.forgotPasswordButton.centerXAnchor constraintEqualToAnchor:self.contentView.centerXAnchor].active = YES;
|
|
[self.forgotPasswordButton.topAnchor constraintEqualToAnchor:self.submitButton.bottomAnchor constant:35].active = YES;
|
|
|
|
[self.submitButton.centerXAnchor constraintEqualToAnchor:self.contentView.centerXAnchor].active = YES;
|
|
[self.submitButton.leadingAnchor constraintEqualToAnchor:self.contentView.leadingAnchor constant:45].active = YES;
|
|
|
|
_keyboardAvoider = [[KeyboardAvoider alloc] initWithScrollViewContainerView:self.view scrollView:self.authenticationScrollView];
|
|
|
|
[BwiSettings.shared reset];
|
|
}
|
|
|
|
-(void)setupPasswordIndicator:(AuthInputsView *)authInputsView
|
|
{
|
|
// make sure that we always start with password entry field where the user input is hidden
|
|
UITextField *passwordTextField = [authInputsView passWordTextField];
|
|
[passwordTextField setSecureTextEntry:TRUE];
|
|
|
|
if (BuildSettings.passwordIndicatorOnLogin)
|
|
{
|
|
[authInputsView.passwordVisibilityToggleButton setTintColor: ThemeService.shared.theme.tintColor];
|
|
[authInputsView.passwordVisibilityToggleButton addTarget:self action:@selector(onPasswordVisibilityToggleButtonPressed:) forControlEvents:UIControlEventTouchUpInside];
|
|
} else {
|
|
[authInputsView.passwordVisibilityToggleButton setHidden:TRUE];
|
|
[authInputsView.passwordVisibilityToggleButton setUserInteractionEnabled:FALSE];
|
|
}
|
|
}
|
|
|
|
- (void)presentForgotPasswordInformationAlert
|
|
{
|
|
UIAlertController *alert = [UIAlertController alertControllerWithTitle:NSLocalizedStringFromTable(@"auth_forgot_password", @"Vector", nil)
|
|
message:NSLocalizedStringFromTable(@"bwi_auth_forgot_password_alert_text", @"Vector", nil)
|
|
preferredStyle:UIAlertControllerStyleAlert];
|
|
[alert addAction:[UIAlertAction actionWithTitle:[VectorL10n ok] style:UIAlertActionStyleDefault handler:nil]];
|
|
[self presentViewController:alert animated:YES completion:nil];
|
|
}
|
|
|
|
- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id <UIViewControllerTransitionCoordinator>)coordinator
|
|
{
|
|
UIDeviceOrientation deviceOrientation = [[UIDevice currentDevice] orientation];
|
|
self.authInputsContainerViewTopConstraint.constant = deviceOrientation == UIDeviceOrientationPortrait ? 190 : 160;
|
|
|
|
MXAuthenticationSession *authSession = [MXAuthenticationSession modelFromJSON:@{@"flows":@[@{@"stages":@[kMXLoginFlowTypePassword]}]}];
|
|
[self.authInputsView setAuthSession:authSession withAuthType:MXKAuthenticationTypeLogin];
|
|
}
|
|
|
|
- (void)userInterfaceThemeDidChange
|
|
{
|
|
[ThemeService.shared.theme applyStyleOnNavigationBar:self.navigationController.navigationBar
|
|
withModernScrollEdgeAppearance:YES];
|
|
|
|
self.view.backgroundColor = ThemeService.shared.theme.backgroundColor;
|
|
|
|
self.authenticationScrollView.backgroundColor = ThemeService.shared.theme.backgroundColor;
|
|
|
|
self.welcomeImageView.tintColor = ThemeService.shared.theme.tintColor;
|
|
|
|
// Style the authentication fallback webview screen so that its header matches to navigation bar style
|
|
self.authFallbackContentView.backgroundColor = ThemeService.shared.theme.baseColor;
|
|
self.cancelAuthFallbackButton.tintColor = ThemeService.shared.theme.baseTextPrimaryColor;
|
|
|
|
if (self.homeServerTextField.placeholder)
|
|
{
|
|
self.homeServerTextField.attributedPlaceholder = [[NSAttributedString alloc]
|
|
initWithString:self.homeServerTextField.placeholder
|
|
attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}];
|
|
}
|
|
if (self.identityServerTextField.placeholder)
|
|
{
|
|
self.identityServerTextField.attributedPlaceholder = [[NSAttributedString alloc]
|
|
initWithString:self.identityServerTextField.placeholder
|
|
attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.placeholderTextColor}];
|
|
}
|
|
|
|
self.submitButton.backgroundColor = ThemeService.shared.theme.tintColor;
|
|
self.skipButton.backgroundColor = ThemeService.shared.theme.tintColor;
|
|
|
|
self.authenticationActivityIndicator.color = ThemeService.shared.theme.textSecondaryColor;
|
|
self.authenticationActivityIndicatorContainerView.backgroundColor = ThemeService.shared.theme.baseColor;
|
|
self.noFlowLabel.textColor = ThemeService.shared.theme.warningColor;
|
|
|
|
NSMutableAttributedString *forgotPasswordTitle = [[NSMutableAttributedString alloc] initWithString:[VectorL10n authForgotPassword]];
|
|
[forgotPasswordTitle addAttribute:NSUnderlineStyleAttributeName value:@(NSUnderlineStyleSingle) range:NSMakeRange(0, forgotPasswordTitle.length)];
|
|
[forgotPasswordTitle addAttribute:NSForegroundColorAttributeName value:ThemeService.shared.theme.tintColor range:NSMakeRange(0, forgotPasswordTitle.length)];
|
|
[self.forgotPasswordButton setAttributedTitle:forgotPasswordTitle forState:UIControlStateNormal];
|
|
[self.forgotPasswordButton setAttributedTitle:forgotPasswordTitle forState:UIControlStateHighlighted];
|
|
|
|
NSMutableAttributedString *forgotPasswordTitleDisabled = [[NSMutableAttributedString alloc] initWithAttributedString:forgotPasswordTitle];
|
|
[forgotPasswordTitleDisabled addAttribute:NSForegroundColorAttributeName value:[ThemeService.shared.theme.tintColor colorWithAlphaComponent:0.3] range:NSMakeRange(0, forgotPasswordTitle.length)];
|
|
[self.forgotPasswordButton setAttributedTitle:forgotPasswordTitleDisabled forState:UIControlStateDisabled];
|
|
|
|
[self updateForgotPwdButtonVisibility];
|
|
|
|
NSAttributedString *serverOptionsTitle = [[NSAttributedString alloc] initWithString:[VectorL10n authUseServerOptions] attributes:@{NSForegroundColorAttributeName : ThemeService.shared.theme.textSecondaryColor, NSFontAttributeName: [UIFont systemFontOfSize:14]}];
|
|
[self.customServersTickButton setAttributedTitle:serverOptionsTitle forState:UIControlStateNormal];
|
|
[self.customServersTickButton setAttributedTitle:serverOptionsTitle forState:UIControlStateHighlighted];
|
|
|
|
self.homeServerSeparator.backgroundColor = ThemeService.shared.theme.lineBreakColor;
|
|
self.homeServerTextField.textColor = ThemeService.shared.theme.textPrimaryColor;
|
|
self.homeServerLabel.textColor = ThemeService.shared.theme.textSecondaryColor;
|
|
|
|
self.identityServerSeparator.backgroundColor = ThemeService.shared.theme.lineBreakColor;
|
|
self.identityServerTextField.textColor = ThemeService.shared.theme.textPrimaryColor;
|
|
self.identityServerLabel.textColor = ThemeService.shared.theme.textSecondaryColor;
|
|
|
|
self.headlineIntroLabel.textColor = ThemeService.shared.theme.textPrimaryColor;
|
|
self.subheadlineIntroLabel.textColor = ThemeService.shared.theme.textSecondaryColor;
|
|
|
|
self.activityIndicator.backgroundColor = ThemeService.shared.theme.overlayBackgroundColor;
|
|
|
|
self.softLogoutClearDataLabel.textColor = ThemeService.shared.theme.textPrimaryColor;
|
|
self.softLogoutClearDataButton.backgroundColor = ThemeService.shared.theme.warningColor;
|
|
|
|
self.customServersTickButton.tintColor = ThemeService.shared.theme.tintColor;
|
|
|
|
[self.authInputsView customizeViewRendering];
|
|
|
|
[self setNeedsStatusBarAppearanceUpdate];
|
|
}
|
|
|
|
- (void)updateUniversalLink
|
|
{
|
|
UniversalLink *link = [AppDelegate theDelegate].lastHandledUniversalLink;
|
|
if (link)
|
|
{
|
|
NSString *emailAddress = link.queryParams[@"email"];
|
|
if (emailAddress && self.authInputsView)
|
|
{
|
|
AuthInputsView *inputsView = (AuthInputsView *)self.authInputsView;
|
|
inputsView.emailTextField.text = emailAddress;
|
|
}
|
|
}
|
|
}
|
|
|
|
- (UIStatusBarStyle)preferredStatusBarStyle
|
|
{
|
|
return ThemeService.shared.theme.statusBarStyle;
|
|
}
|
|
|
|
- (void)viewWillAppear:(BOOL)animated
|
|
{
|
|
[super viewWillAppear:animated];
|
|
|
|
[_keyboardAvoider startAvoiding];
|
|
[self.navigationController setNavigationBarHidden:NO animated:YES];
|
|
}
|
|
|
|
- (void)viewDidAppear:(BOOL)animated
|
|
{
|
|
[super viewDidAppear:animated];
|
|
|
|
if (self.isFirstViewAppearing)
|
|
{
|
|
self.firstViewAppearing = NO;
|
|
}
|
|
|
|
// Verify that the app does not show the authentication screen whereas
|
|
// the user has already logged in.
|
|
// This bug rarely happens (https://github.com/vector-im/riot-ios/issues/1643)
|
|
// but it invites the user to log in again. They will then lose all their
|
|
// e2e messages.
|
|
if (!didCheckFalseAuthScreenDisplay)
|
|
{
|
|
didCheckFalseAuthScreenDisplay = YES;
|
|
|
|
MXLogDebug(@"[AuthenticationVC] viewDidAppear: Checking false logout");
|
|
[MXKAccountManager sharedManagerWithReload: YES];
|
|
if ([MXKAccountManager sharedManager].activeAccounts.count)
|
|
{
|
|
// For now, we do not have better solution than forcing the user to restart the app
|
|
[NSException raise:@"False logout. Kill the app" format:@"AuthenticationViewController has been displayed whereas there is an existing account"];
|
|
}
|
|
}
|
|
|
|
[[AppDelegate theDelegate] checkJailbreak];
|
|
}
|
|
|
|
- (void)viewDidDisappear:(BOOL)animated
|
|
{
|
|
[_keyboardAvoider stopAvoiding];
|
|
|
|
[super viewDidDisappear:animated];
|
|
}
|
|
|
|
- (void)viewDidLayoutSubviews
|
|
{
|
|
[super viewDidLayoutSubviews];
|
|
|
|
if (self.isFirstViewAppearing)
|
|
{
|
|
[self refreshContentViewHeightConstraint];
|
|
}
|
|
|
|
// bwRegisterButton has no constraints so we must set the frame position and size here
|
|
CGRect passwordframe = self.forgotPasswordButton.frame;
|
|
CGRect registerFrame = CGRectMake(self.forgotPasswordButton.frame.origin.x, passwordframe.origin.y + 85, self.forgotPasswordButton.frame.size.width , passwordframe.size.height);
|
|
self.bwRegisterButton.frame = registerFrame;
|
|
}
|
|
|
|
- (void)destroy
|
|
{
|
|
[super destroy];
|
|
|
|
if (kThemeServiceDidChangeThemeNotificationObserver)
|
|
{
|
|
[[NSNotificationCenter defaultCenter] removeObserver:kThemeServiceDidChangeThemeNotificationObserver];
|
|
kThemeServiceDidChangeThemeNotificationObserver = nil;
|
|
}
|
|
|
|
if (universalLinkDidChangeNotificationObserver)
|
|
{
|
|
[[NSNotificationCenter defaultCenter] removeObserver:universalLinkDidChangeNotificationObserver];
|
|
universalLinkDidChangeNotificationObserver = nil;
|
|
}
|
|
|
|
[self.authenticationActivityIndicator removeObserver:self forKeyPath:@"hidden"];
|
|
|
|
autoDiscovery = nil;
|
|
_keyboardAvoider = nil;
|
|
}
|
|
|
|
- (BOOL)isIdentityServerConfigured
|
|
{
|
|
return self.identityServerTextField.text.length > 0;
|
|
}
|
|
|
|
- (void)setAuthType:(MXKAuthenticationType)authType
|
|
{
|
|
if (self.authType == MXKAuthenticationTypeRegister)
|
|
{
|
|
// Restore the default registration screen
|
|
[self updateRegistrationScreenWithThirdPartyIdentifiersHidden:YES];
|
|
}
|
|
|
|
super.authType = authType;
|
|
|
|
if (authType == MXKAuthenticationTypeLogin)
|
|
{
|
|
[self.submitButton setTitle:[VectorL10n authLogin] forState:UIControlStateNormal];
|
|
[self.submitButton setTitle:[VectorL10n authLogin] forState:UIControlStateHighlighted];
|
|
}
|
|
else if (authType == MXKAuthenticationTypeRegister)
|
|
{
|
|
[self.submitButton setTitle:[VectorL10n authRegister] forState:UIControlStateNormal];
|
|
[self.submitButton setTitle:[VectorL10n authRegister] forState:UIControlStateHighlighted];
|
|
}
|
|
else if (authType == MXKAuthenticationTypeForgotPassword)
|
|
{
|
|
if (isPasswordReseted)
|
|
{
|
|
[self.submitButton setTitle:[VectorL10n authReturnToLogin] forState:UIControlStateNormal];
|
|
[self.submitButton setTitle:[VectorL10n authReturnToLogin] forState:UIControlStateHighlighted];
|
|
}
|
|
else
|
|
{
|
|
[self.submitButton setTitle:[VectorL10n authSendResetEmail] forState:UIControlStateNormal];
|
|
[self.submitButton setTitle:[VectorL10n authSendResetEmail] forState:UIControlStateHighlighted];
|
|
}
|
|
}
|
|
|
|
[self updateAuthInputViewVisibility];
|
|
[self updateForgotPwdButtonVisibility];
|
|
[self updateSoftLogoutClearDataContainerVisibility];
|
|
[self updateSocialLoginViewVisibility];
|
|
}
|
|
|
|
- (void)setAuthInputsView:(MXKAuthInputsView *)authInputsView
|
|
{
|
|
// Keep the current country code if any.
|
|
if ([self.authInputsView isKindOfClass:AuthInputsView.class])
|
|
{
|
|
// We will reuse the current country code
|
|
defaultCountryCode = ((AuthInputsView*)self.authInputsView).isoCountryCode;
|
|
}
|
|
|
|
// Finalize the new auth inputs view
|
|
if ([authInputsView isKindOfClass:AuthInputsView.class])
|
|
{
|
|
AuthInputsView *authInputsview = (AuthInputsView*)authInputsView;
|
|
|
|
// Retrieve the MCC from the SIM card information (Note: the phone book country code is not defined yet)
|
|
NSString *countryCode = [MXKAppSettings standardAppSettings].phonebookCountryCode;
|
|
if (!countryCode)
|
|
{
|
|
// If none, consider the preferred locale
|
|
NSLocale *local = [[NSLocale alloc] initWithLocaleIdentifier:[[NSBundle mainBundle] preferredLocalizations][0]];
|
|
if ([local respondsToSelector:@selector(countryCode)])
|
|
{
|
|
countryCode = local.countryCode;
|
|
}
|
|
|
|
if (!countryCode)
|
|
{
|
|
countryCode = defaultCountryCode;
|
|
}
|
|
}
|
|
authInputsview.isoCountryCode = countryCode;
|
|
authInputsview.delegate = self;
|
|
}
|
|
|
|
[super setAuthInputsView:authInputsView];
|
|
|
|
// Restore here the actual content view height.
|
|
// Indeed this height has been modified according to the authInputsView height in the default implementation of MXKAuthenticationViewController.
|
|
[self refreshContentViewHeightConstraint];
|
|
|
|
// the authentication indicator should be the front most view
|
|
[self.authInputsContainerView bringSubviewToFront:self.authenticationActivityIndicatorContainerView];
|
|
}
|
|
|
|
- (void)updateAuthInputViewVisibility
|
|
{
|
|
BOOL hideAuthInputView = NO;
|
|
|
|
// Hide input view when there is only social login actions to present at login
|
|
if ((self.authType == MXKAuthenticationTypeLogin)
|
|
&& self.currentLoginSSOFlow
|
|
&& !self.isAuthSessionContainsPasswordFlow
|
|
&& BuildSettings.authScreenShowSocialLoginSection)
|
|
{
|
|
hideAuthInputView = YES;
|
|
}
|
|
|
|
// Note: Registration will hide the input view in onFailureDuringMXOperation
|
|
// if registration has been disabled.
|
|
|
|
self.authInputsView.hidden = hideAuthInputView;
|
|
}
|
|
|
|
- (void)setUserInteractionEnabled:(BOOL)userInteractionEnabled
|
|
{
|
|
super.userInteractionEnabled = userInteractionEnabled;
|
|
|
|
// Reset
|
|
self.navigationItem.rightBarButtonItem.enabled = YES;
|
|
|
|
// Show/Hide server options
|
|
if (_optionsContainer.hidden == userInteractionEnabled)
|
|
{
|
|
_optionsContainer.hidden = !userInteractionEnabled;
|
|
|
|
[self refreshContentViewHeightConstraint];
|
|
}
|
|
|
|
// Update the label of the right bar button according to its actual action.
|
|
if (!userInteractionEnabled)
|
|
{
|
|
// The right bar button is used to cancel the running request.
|
|
self.navigationItem.rightBarButtonItem.title = [VectorL10n cancel];
|
|
|
|
// Remove the potential back button.
|
|
self.navigationItem.leftBarButtonItem = nil;
|
|
[self.navigationItem setHidesBackButton:YES];
|
|
}
|
|
else
|
|
{
|
|
AuthInputsView *authInputsview;
|
|
if ([self.authInputsView isKindOfClass:AuthInputsView.class])
|
|
{
|
|
authInputsview = (AuthInputsView*)self.authInputsView;
|
|
}
|
|
|
|
// The right bar button is used to switch the authentication type.
|
|
if (self.authType == MXKAuthenticationTypeLogin)
|
|
{
|
|
if (!authInputsview.isSingleSignOnRequired
|
|
&& !self.softLogoutCredentials
|
|
&& BuildSettings.authScreenShowRegister)
|
|
{
|
|
self.navigationItem.rightBarButtonItem.title = [VectorL10n authRegister];
|
|
}
|
|
else
|
|
{
|
|
// Disable register on SSO
|
|
self.navigationItem.rightBarButtonItem.enabled = NO;
|
|
self.navigationItem.rightBarButtonItem.title = nil;
|
|
}
|
|
}
|
|
else if (self.authType == MXKAuthenticationTypeRegister)
|
|
{
|
|
self.navigationItem.rightBarButtonItem.title = [VectorL10n authLogin];
|
|
|
|
// Restore the back button
|
|
if (authInputsview)
|
|
{
|
|
[self updateRegistrationScreenWithThirdPartyIdentifiersHidden:authInputsview.thirdPartyIdentifiersHidden];
|
|
}
|
|
}
|
|
else if (self.authType == MXKAuthenticationTypeForgotPassword)
|
|
{
|
|
// The right bar button is used to return to login.
|
|
self.navigationItem.rightBarButtonItem.title = [VectorL10n cancel];
|
|
}
|
|
}
|
|
}
|
|
|
|
- (BOOL)continueSSOLoginWithToken:(NSString*)loginToken txnId:(NSString*)txnId
|
|
{
|
|
// The presenter isn't dismissed automatically when finishing via a deep link
|
|
if (self.ssoAuthenticationPresenter)
|
|
{
|
|
[self dismissSSOAuthenticationPresenter];
|
|
}
|
|
|
|
// Check if transaction id is the same as expected
|
|
if (loginToken &&
|
|
txnId && self.ssoCallbackTxnId
|
|
&& [txnId isEqualToString:self.ssoCallbackTxnId])
|
|
{
|
|
[self loginWithToken:loginToken];
|
|
return YES;
|
|
}
|
|
|
|
MXLogDebug(@"[AuthenticationVC] Fail to continue SSO login");
|
|
return NO;
|
|
}
|
|
|
|
#pragma mark - Fallback URL display
|
|
|
|
- (void)showAuthenticationFallBackView:(NSString*)fallbackPage
|
|
{
|
|
// Skip MatrixKit and use a VC instead
|
|
if (self.softLogoutCredentials)
|
|
{
|
|
// Add device_id as query param of the fallback
|
|
NSURLComponents *components = [[NSURLComponents alloc] initWithString:fallbackPage];
|
|
|
|
NSMutableArray<NSURLQueryItem*> *queryItems = [components.queryItems mutableCopy];
|
|
if (!queryItems)
|
|
{
|
|
queryItems = [NSMutableArray array];
|
|
}
|
|
|
|
[queryItems addObject:[NSURLQueryItem queryItemWithName:@"device_id"
|
|
value:self.softLogoutCredentials.deviceId]];
|
|
|
|
components.queryItems = queryItems;
|
|
|
|
fallbackPage = components.URL.absoluteString;
|
|
}
|
|
|
|
[self showAuthenticationFallBackViewController:fallbackPage];
|
|
}
|
|
|
|
- (void)showAuthenticationFallBackViewController:(NSString*)fallbackPage
|
|
{
|
|
authFallBackViewController = [[AuthFallBackViewController alloc] initWithURL:fallbackPage];
|
|
authFallBackViewController.delegate = self;
|
|
|
|
|
|
authFallBackViewController.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(dismissFallBackViewController:)];
|
|
|
|
UINavigationController *navigationController = [[RiotNavigationController alloc] initWithRootViewController:authFallBackViewController];
|
|
[self presentViewController:navigationController animated:YES completion:nil];
|
|
}
|
|
|
|
- (void)dismissFallBackViewController:(id)sender
|
|
{
|
|
[authFallBackViewController dismissViewControllerAnimated:YES completion:nil];
|
|
authFallBackViewController = nil;
|
|
}
|
|
|
|
|
|
#pragma mark AuthFallBackViewControllerDelegate
|
|
|
|
- (void)authFallBackViewController:(AuthFallBackViewController *)authFallBackViewController
|
|
didLoginWithLoginResponse:(MXLoginResponse *)loginResponse
|
|
{
|
|
[authFallBackViewController dismissViewControllerAnimated:YES completion:^{
|
|
|
|
MXCredentials *credentials = [[MXCredentials alloc] initWithLoginResponse:loginResponse andDefaultCredentials:nil];
|
|
[self onSuccessfulLogin:credentials];
|
|
}];
|
|
|
|
authFallBackViewController = nil;
|
|
}
|
|
|
|
|
|
- (void)authFallBackViewControllerDidClose:(AuthFallBackViewController *)authFallBackViewController
|
|
{
|
|
[self dismissFallBackViewController:nil];
|
|
}
|
|
|
|
|
|
- (void)setSoftLogoutCredentials:(MXCredentials *)softLogoutCredentials
|
|
{
|
|
[super setSoftLogoutCredentials:softLogoutCredentials];
|
|
|
|
if (softLogoutCredentials)
|
|
{
|
|
// Customise the screen for soft logout
|
|
self.customServersTickButton.hidden = YES;
|
|
self.navigationItem.rightBarButtonItem.title = nil;
|
|
self.navigationItem.title = [VectorL10n authSoftlogoutSignedOut];
|
|
[self showSoftLogoutClearDataContainer];
|
|
}
|
|
else
|
|
{
|
|
// Customise the screen for regular authentication.
|
|
self.customServersTickButton.hidden = NO;
|
|
[self updateRightBarButtonItem];
|
|
self.navigationItem.title = nil;
|
|
self.softLogoutClearDataContainer.hidden = YES;
|
|
}
|
|
}
|
|
|
|
- (void)showSoftLogoutClearDataContainer
|
|
{
|
|
NSMutableAttributedString *message = [[NSMutableAttributedString alloc] initWithString:[VectorL10n authSoftlogoutClearData]
|
|
attributes:@{
|
|
NSFontAttributeName: [UIFont boldSystemFontOfSize:14]
|
|
}];
|
|
|
|
[message appendAttributedString:[[NSAttributedString alloc] initWithString:@"\n\n"]];
|
|
|
|
NSString *string = [NSString stringWithFormat:@"%@\n\n%@",
|
|
[VectorL10n authSoftlogoutClearDataMessage1],
|
|
[VectorL10n authSoftlogoutClearDataMessage2]];
|
|
|
|
[message appendAttributedString:[[NSAttributedString alloc] initWithString:string
|
|
attributes:@{
|
|
NSFontAttributeName: [UIFont systemFontOfSize:14]
|
|
}]];
|
|
self.softLogoutClearDataLabel.attributedText = message;
|
|
|
|
self.softLogoutClearDataContainer.hidden = NO;
|
|
[self refreshContentViewHeightConstraint];
|
|
}
|
|
|
|
- (void)updateSoftLogoutClearDataContainerVisibility
|
|
{
|
|
// Do not display it in case of forget password flow
|
|
if (self.softLogoutCredentials && self.authType == MXKAuthenticationTypeLogin)
|
|
{
|
|
self.softLogoutClearDataContainer.hidden = NO;
|
|
}
|
|
else
|
|
{
|
|
self.softLogoutClearDataContainer.hidden = YES;
|
|
}
|
|
}
|
|
|
|
/**
|
|
Filter and prioritise flows supported by the app.
|
|
|
|
@param authSession the auth session coming from the HS.
|
|
@return a new auth session
|
|
*/
|
|
- (MXAuthenticationSession*)handleSupportedFlowsInAuthenticationSession:(MXAuthenticationSession *)authSession
|
|
{
|
|
MXLoginSSOFlow *ssoFlow;
|
|
MXLoginFlow *passwordFlow;
|
|
NSMutableArray *supportedFlows = [NSMutableArray array];
|
|
|
|
for (MXLoginFlow *flow in authSession.flows)
|
|
{
|
|
// Remove known flows we do not support
|
|
if (![flow.type isEqualToString:kMXLoginFlowTypeToken])
|
|
{
|
|
MXLogDebug(@"[AuthenticationVC] handleSupportedFlowsInAuthenticationSession: Filter out flow %@", flow.type);
|
|
[supportedFlows addObject:flow];
|
|
}
|
|
|
|
if ([flow.type isEqualToString:kMXLoginFlowTypePassword])
|
|
{
|
|
passwordFlow = flow;
|
|
}
|
|
|
|
if ([flow isKindOfClass:MXLoginSSOFlow.class])
|
|
{
|
|
MXLogDebug(@"[AuthenticationVC] handleSupportedFlowsInAuthenticationSession: Prioritise flow %@", flow.type);
|
|
ssoFlow = (MXLoginSSOFlow *)flow;
|
|
}
|
|
}
|
|
|
|
// Prioritise SSO over other flows
|
|
if (ssoFlow)
|
|
{
|
|
[supportedFlows removeAllObjects];
|
|
[supportedFlows addObject:ssoFlow];
|
|
|
|
// If the SSO contains Identity Providers list and password
|
|
// Display both social login and password input
|
|
if (ssoFlow.identityProviders.count && passwordFlow)
|
|
{
|
|
[supportedFlows addObject:passwordFlow];
|
|
}
|
|
}
|
|
|
|
if (supportedFlows.count != authSession.flows.count)
|
|
{
|
|
MXAuthenticationSession *updatedAuthSession = [[MXAuthenticationSession alloc] init];
|
|
updatedAuthSession.session = authSession.session;
|
|
updatedAuthSession.params = authSession.params;
|
|
updatedAuthSession.flows = supportedFlows;
|
|
return updatedAuthSession;
|
|
}
|
|
else
|
|
{
|
|
return authSession;
|
|
}
|
|
}
|
|
|
|
- (void)refreshAuthenticationSession
|
|
{
|
|
// Hide the social login buttons while the session refreshes
|
|
[self hideSocialLoginView];
|
|
[super refreshAuthenticationSession];
|
|
}
|
|
|
|
- (void)handleAuthenticationSession:(MXAuthenticationSession *)authSession withFallbackSSOFlow:(MXLoginSSOFlow *)fallbackSSOFlow
|
|
{
|
|
// Make some cleaning from the server response according to what the app supports
|
|
authSession = [self handleSupportedFlowsInAuthenticationSession:authSession];
|
|
|
|
[super handleAuthenticationSession:authSession withFallbackSSOFlow:fallbackSSOFlow];
|
|
|
|
self.currentLoginSSOFlow = [self loginSSOFlowWithProvidersFromFlows:authSession.flows] ?: fallbackSSOFlow;
|
|
|
|
[self updateAuthInputViewVisibility];
|
|
[self updateSocialLoginViewVisibility];
|
|
|
|
AuthInputsView *authInputsview;
|
|
if ([self.authInputsView isKindOfClass:AuthInputsView.class])
|
|
{
|
|
authInputsview = (AuthInputsView*)self.authInputsView;
|
|
[self updateUniversalLink];
|
|
}
|
|
|
|
// Hide "Forgot password" and "Log in" buttons in case of SSO
|
|
[self updateForgotPwdButtonVisibility];
|
|
[self updateSoftLogoutClearDataContainerVisibility];
|
|
|
|
self.submitButton.hidden = authInputsview.isSingleSignOnRequired || authInputsview.isHidden;
|
|
|
|
// Bind ssoButton again if self.authInputsView has changed
|
|
[authInputsview.ssoButton addTarget:self action:@selector(onButtonPressed:) forControlEvents:UIControlEventTouchUpInside];
|
|
|
|
if (authInputsview.isSingleSignOnRequired && self.softLogoutCredentials)
|
|
{
|
|
// Remove submitButton so that the 2nd contraint on softLogoutClearDataContainer.top will be applied
|
|
// That makes softLogoutClearDataContainer appear upper in the screen
|
|
[self.submitButton removeFromSuperview];
|
|
}
|
|
|
|
[self refreshContentViewHeightConstraint];
|
|
}
|
|
|
|
- (BOOL)isAuthSessionContainsPasswordFlow
|
|
{
|
|
BOOL containsPassword = NO;
|
|
|
|
if (self.authInputsView.authSession)
|
|
{
|
|
containsPassword = [self containsPasswordFlowInFlows:self.authInputsView.authSession.flows];
|
|
}
|
|
|
|
return containsPassword;
|
|
}
|
|
|
|
- (BOOL)containsPasswordFlowInFlows:(NSArray<MXLoginFlow*>*)loginFlows
|
|
{
|
|
for (MXLoginFlow *loginFlow in loginFlows)
|
|
{
|
|
if ([loginFlow.type isEqualToString:kMXLoginFlowTypePassword])
|
|
{
|
|
return YES;
|
|
}
|
|
}
|
|
|
|
return NO;
|
|
}
|
|
|
|
|
|
- (IBAction)onPasswordVisibilityToggleButtonPressed:(UIButton *)button {
|
|
// make sure we get the correct view and not the matrix kit superview which we don't want
|
|
AuthInputsView* bwiAuthInputView = (AuthInputsView *)[self authInputsView];
|
|
|
|
UITextField *passwordTextField = [bwiAuthInputView passWordTextField];
|
|
[passwordTextField setSecureTextEntry:![passwordTextField isSecureTextEntry]];
|
|
|
|
UIImage *eyeImage = [UIImage imageNamed:passwordTextField.isSecureTextEntry ? @"reveal_password_button" : @"hide_password_button"];
|
|
[button setImage:eyeImage forState:UIControlStateNormal];
|
|
}
|
|
|
|
- (IBAction)onButtonPressed:(id)sender
|
|
{
|
|
if (sender == self.customServersTickButton)
|
|
{
|
|
[self setCustomServerFieldsVisible:self.customServersContainer.hidden];
|
|
}
|
|
else if (sender == self.forgotPasswordButton)
|
|
{
|
|
if( [BuildSettings forgotPasswordInformationAlert] ) {
|
|
[self presentForgotPasswordInformationAlert];
|
|
}
|
|
else if (!self.isIdentityServerConfigured)
|
|
{
|
|
UIAlertController *alert = [UIAlertController alertControllerWithTitle:[VectorL10n error]
|
|
message:[VectorL10n authForgotPasswordErrorNoConfiguredIdentityServer]
|
|
preferredStyle:UIAlertControllerStyleAlert];
|
|
[alert addAction:[UIAlertAction actionWithTitle:[VectorL10n ok] style:UIAlertActionStyleDefault handler:nil]];
|
|
[self presentViewController:alert animated:YES completion:nil];
|
|
|
|
return;
|
|
}
|
|
else
|
|
{
|
|
// Update UI to reset password
|
|
self.authType = MXKAuthenticationTypeForgotPassword;
|
|
}
|
|
}
|
|
else if (sender == self.navigationItem.rightBarButtonItem)
|
|
{
|
|
// Check whether a request is in progress
|
|
if (!self.userInteractionEnabled)
|
|
{
|
|
// Cancel the current operation
|
|
[self cancel];
|
|
}
|
|
else if (self.authType == MXKAuthenticationTypeLogin)
|
|
{
|
|
self.authType = MXKAuthenticationTypeRegister;
|
|
[self updateRightBarButtonItem];
|
|
}
|
|
else
|
|
{
|
|
self.authType = MXKAuthenticationTypeLogin;
|
|
[self updateRightBarButtonItem];
|
|
}
|
|
}
|
|
else if (sender == self.navigationItem.leftBarButtonItem)
|
|
{
|
|
if ([self.authInputsView isKindOfClass:AuthInputsView.class])
|
|
{
|
|
AuthInputsView *authInputsview = (AuthInputsView*)self.authInputsView;
|
|
|
|
// Hide the supported 3rd party ids which may be added to the account
|
|
authInputsview.thirdPartyIdentifiersHidden = YES;
|
|
|
|
[self updateRegistrationScreenWithThirdPartyIdentifiersHidden:YES];
|
|
|
|
// Show the social login buttons again if needed.
|
|
[self updateSocialLoginViewVisibility];
|
|
|
|
// Allow backward navigation in the flow again.
|
|
[self.navigationItem setHidesBackButton:NO];
|
|
}
|
|
}
|
|
else if (sender == self.submitButton)
|
|
{
|
|
// Handle here the second screen used to manage the 3rd party ids during the registration.
|
|
// Except if there is an external set of parameters defined to perform a registration.
|
|
if (self.authType == MXKAuthenticationTypeRegister && !self.externalRegistrationParameters)
|
|
{
|
|
// Sanity check
|
|
if ([self.authInputsView isKindOfClass:AuthInputsView.class])
|
|
{
|
|
AuthInputsView *authInputsview = (AuthInputsView*)self.authInputsView;
|
|
|
|
// Show the 3rd party ids screen if it is not shown yet
|
|
if (authInputsview.areThirdPartyIdentifiersSupported && authInputsview.isThirdPartyIdentifiersHidden)
|
|
{
|
|
[self dismissKeyboard];
|
|
|
|
[self.authenticationActivityIndicator startAnimating];
|
|
|
|
// Check parameters validity
|
|
NSString *errorMsg = [self.authInputsView validateParameters];
|
|
if (errorMsg)
|
|
{
|
|
[self onFailureDuringAuthRequest:[NSError errorWithDomain:MXKAuthErrorDomain code:0 userInfo:@{NSLocalizedDescriptionKey:errorMsg}]];
|
|
}
|
|
else
|
|
{
|
|
[self testUserRegistration:^(MXError *mxError) {
|
|
// We consider that a user can be registered if:
|
|
// - the username is not already in use
|
|
if ([mxError.errcode isEqualToString:kMXErrCodeStringUserInUse])
|
|
{
|
|
MXLogDebug(@"[AuthenticationVC] User name is already use");
|
|
[self onFailureDuringAuthRequest:[NSError errorWithDomain:MXKAuthErrorDomain code:0 userInfo:@{NSLocalizedDescriptionKey:[VectorL10n authUsernameInUse]}]];
|
|
}
|
|
// - the server quota limits is not reached
|
|
else if ([mxError.errcode isEqualToString:kMXErrCodeStringResourceLimitExceeded])
|
|
{
|
|
[self showResourceLimitExceededError:mxError.userInfo];
|
|
}
|
|
else
|
|
{
|
|
[self.authenticationActivityIndicator stopAnimating];
|
|
|
|
// Hide the social login buttons now that a different flow has started.
|
|
[self hideSocialLoginView];
|
|
|
|
// Show the supported 3rd party ids which may be added to the account
|
|
authInputsview.thirdPartyIdentifiersHidden = NO;
|
|
[self updateRegistrationScreenWithThirdPartyIdentifiersHidden:NO];
|
|
}
|
|
}];
|
|
}
|
|
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
|
|
[super onButtonPressed:sender];
|
|
}
|
|
else if (sender == self.skipButton)
|
|
{
|
|
// Reset the potential email or phone values
|
|
if ([self.authInputsView isKindOfClass:AuthInputsView.class])
|
|
{
|
|
AuthInputsView *authInputsview = (AuthInputsView*)self.authInputsView;
|
|
|
|
[authInputsview resetThirdPartyIdentifiers];
|
|
}
|
|
|
|
[super onButtonPressed:self.submitButton];
|
|
}
|
|
else if (sender == ((AuthInputsView*)self.authInputsView).ssoButton)
|
|
{
|
|
[self presentDefaultSSOAuthentication];
|
|
}
|
|
else if (sender == self.softLogoutClearDataButton)
|
|
{
|
|
[self.authVCDelegate authenticationViewControllerDidRequestClearAllData:self];
|
|
}
|
|
else
|
|
{
|
|
[super onButtonPressed:sender];
|
|
}
|
|
|
|
[self updateSoftLogoutClearDataContainerVisibility];
|
|
}
|
|
|
|
- (void)onFailureDuringAuthRequest:(NSError *)error
|
|
{
|
|
MXError *mxError = [[MXError alloc] initWithNSError:error];
|
|
if ([mxError.errcode isEqualToString:kMXErrCodeStringResourceLimitExceeded])
|
|
{
|
|
[self showResourceLimitExceededError:mxError.userInfo];
|
|
}
|
|
else
|
|
{
|
|
[super onFailureDuringAuthRequest:error];
|
|
}
|
|
}
|
|
|
|
- (void)onSuccessfulLogin:(MXCredentials*)credentials
|
|
{
|
|
// Is pin protection forced?
|
|
if ([PinCodePreferences shared].forcePinProtection)
|
|
{
|
|
loginCredentials = credentials;
|
|
|
|
SetPinCoordinatorViewMode viewMode = SetPinCoordinatorViewModeSetPin;
|
|
switch (self.authType) {
|
|
case MXKAuthenticationTypeLogin:
|
|
viewMode = SetPinCoordinatorViewModeSetPinAfterLogin;
|
|
break;
|
|
case MXKAuthenticationTypeRegister:
|
|
viewMode = SetPinCoordinatorViewModeSetPinAfterRegister;
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
|
|
SetPinCoordinatorBridgePresenter *presenter = [[SetPinCoordinatorBridgePresenter alloc] initWithSession:nil viewMode:viewMode];
|
|
presenter.delegate = self;
|
|
[presenter presentFrom:self animated:YES];
|
|
self.setPinCoordinatorBridgePresenter = presenter;
|
|
return;
|
|
}
|
|
|
|
[self afterSetPinFlowCompletedWithCredentials:credentials];
|
|
}
|
|
|
|
- (void)updateRightBarButtonItem
|
|
{
|
|
if (self.authType == MXKAuthenticationTypeLogin)
|
|
{
|
|
self.navigationItem.rightBarButtonItem.title = [VectorL10n authRegister];
|
|
}
|
|
else
|
|
{
|
|
self.navigationItem.rightBarButtonItem.title = [VectorL10n authLogin];
|
|
}
|
|
}
|
|
|
|
- (void)updateForgotPwdButtonVisibility
|
|
{
|
|
AuthInputsView *authInputsview;
|
|
if ([self.authInputsView isKindOfClass:AuthInputsView.class])
|
|
{
|
|
authInputsview = (AuthInputsView*)self.authInputsView;
|
|
}
|
|
|
|
BOOL showForgotPasswordButton = NO;
|
|
|
|
if (BuildSettings.authScreenShowForgotPassword && authInputsview.isHidden == NO)
|
|
{
|
|
showForgotPasswordButton = (self.authType == MXKAuthenticationTypeLogin) && !authInputsview.isSingleSignOnRequired;
|
|
}
|
|
|
|
self.forgotPasswordButton.hidden = !showForgotPasswordButton;
|
|
}
|
|
|
|
- (void)afterSetPinFlowCompletedWithCredentials:(MXCredentials*)credentials
|
|
{
|
|
// Check whether a third party identifiers has not been used
|
|
if ([self.authInputsView isKindOfClass:AuthInputsView.class])
|
|
{
|
|
AuthInputsView *authInputsview = (AuthInputsView*)self.authInputsView;
|
|
if (authInputsview.isThirdPartyIdentifierPending)
|
|
{
|
|
// Alert user
|
|
if (alert)
|
|
{
|
|
[alert dismissViewControllerAnimated:NO completion:nil];
|
|
}
|
|
|
|
alert = [UIAlertController alertControllerWithTitle:[VectorL10n warning] message:[VectorL10n authAddEmailAndPhoneWarning] preferredStyle:UIAlertControllerStyleAlert];
|
|
|
|
[alert addAction:[UIAlertAction actionWithTitle:[VectorL10n ok]
|
|
style:UIAlertActionStyleDefault
|
|
handler:^(UIAlertAction * action) {
|
|
|
|
[super onSuccessfulLogin:credentials];
|
|
|
|
}]];
|
|
|
|
[self presentViewController:alert animated:YES completion:nil];
|
|
return;
|
|
}
|
|
}
|
|
|
|
[super onSuccessfulLogin:credentials];
|
|
}
|
|
|
|
#pragma mark -
|
|
|
|
- (void)updateRegistrationScreenWithThirdPartyIdentifiersHidden:(BOOL)thirdPartyIdentifiersHidden
|
|
{
|
|
self.skipButton.hidden = thirdPartyIdentifiersHidden;
|
|
|
|
// Do not display the skip button if the 3PID is mandatory
|
|
if (!thirdPartyIdentifiersHidden)
|
|
{
|
|
if ([self.authInputsView isKindOfClass:AuthInputsView.class])
|
|
{
|
|
AuthInputsView *authInputsview = (AuthInputsView*)self.authInputsView;
|
|
if (authInputsview.isThirdPartyIdentifierRequired)
|
|
{
|
|
self.skipButton.hidden = YES;
|
|
}
|
|
}
|
|
}
|
|
|
|
self.serverOptionsContainer.hidden = !thirdPartyIdentifiersHidden
|
|
|| !BuildSettings.authScreenShowCustomServerOptions;
|
|
[self refreshContentViewHeightConstraint];
|
|
|
|
if (thirdPartyIdentifiersHidden)
|
|
{
|
|
[self.submitButton setTitle:[VectorL10n authRegister] forState:UIControlStateNormal];
|
|
[self.submitButton setTitle:[VectorL10n authRegister] forState:UIControlStateHighlighted];
|
|
|
|
self.navigationItem.leftBarButtonItem = nil;
|
|
}
|
|
else
|
|
{
|
|
[self.submitButton setTitle:[VectorL10n authSubmit] forState:UIControlStateNormal];
|
|
[self.submitButton setTitle:[VectorL10n authSubmit] forState:UIControlStateHighlighted];
|
|
|
|
UIBarButtonItem *leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:VectorL10n.back
|
|
style:UIBarButtonItemStylePlain
|
|
target:self
|
|
action:@selector(onButtonPressed:)];
|
|
self.navigationItem.leftBarButtonItem = leftBarButtonItem;
|
|
}
|
|
}
|
|
|
|
- (void)refreshContentViewHeightConstraint
|
|
{
|
|
[self.view layoutIfNeeded];
|
|
|
|
// Refresh content view height by considering the options container display.
|
|
CGFloat constant = self.optionsContainer.frame.origin.y + 10;
|
|
|
|
if (self.authInputsView.isHidden == NO)
|
|
{
|
|
self.authInputContainerViewMinHeightConstraint.constant = kAuthInputContainerViewMinHeightConstraintConstant;
|
|
self.authInputContainerViewHeightConstraint.constant = self.authInputsView.viewHeightConstraint.constant;
|
|
}
|
|
else
|
|
{
|
|
self.authInputContainerViewMinHeightConstraint.constant = 0;
|
|
self.authInputContainerViewHeightConstraint.constant = 0;
|
|
}
|
|
|
|
// FIX: When authInputsView present recaptcha the height is not taken into account, add it manually here.
|
|
AuthInputsView *authInputsview;
|
|
if ([self.authInputsView isKindOfClass:AuthInputsView.class])
|
|
{
|
|
authInputsview = (AuthInputsView*)self.authInputsView;
|
|
|
|
if (!authInputsview.recaptchaContainer.hidden)
|
|
{
|
|
constant+=authInputsview.frame.size.height;
|
|
}
|
|
}
|
|
|
|
if (!self.optionsContainer.isHidden)
|
|
{
|
|
constant += self.serverOptionsContainer.frame.origin.y;
|
|
|
|
if (!self.serverOptionsContainer.isHidden)
|
|
{
|
|
CGRect customServersContainerFrame = self.customServersContainer.frame;
|
|
constant += customServersContainerFrame.origin.y;
|
|
|
|
if (!self.customServersContainer.isHidden)
|
|
{
|
|
constant += customServersContainerFrame.size.height;
|
|
}
|
|
else
|
|
{
|
|
constant += self.customServersTickButton.frame.size.height;
|
|
}
|
|
}
|
|
}
|
|
|
|
if (!self.softLogoutClearDataContainer.isHidden)
|
|
{
|
|
// The soft logout clear data section adds more height
|
|
constant += self.softLogoutClearDataContainer.frame.size.height;
|
|
}
|
|
|
|
if (self.isSocialLoginViewShown)
|
|
{
|
|
constant += [self socialLoginViewHeightFittingWidth:self.contentView.frame.size.width];
|
|
}
|
|
|
|
if (BuildSettings.bwiEnableRegisterInfo)
|
|
{
|
|
constant += 100;
|
|
}
|
|
|
|
self.contentViewHeightConstraint.constant = constant;
|
|
|
|
[self.view layoutIfNeeded];
|
|
}
|
|
|
|
- (void)setCustomServerFieldsVisible:(BOOL)isVisible
|
|
{
|
|
if (self.customServersContainer.isHidden != isVisible || BuildSettings.authScreenShowTestServerOptions)
|
|
{
|
|
return;
|
|
}
|
|
|
|
if (!isVisible)
|
|
{
|
|
[self.homeServerTextField resignFirstResponder];
|
|
[self.identityServerTextField resignFirstResponder];
|
|
|
|
// Report server url typed by the user as custom url.
|
|
[self saveCustomServerInputs];
|
|
|
|
// Restore default configuration
|
|
[self setHomeServerTextFieldText:self.defaultHomeServerUrl];
|
|
[self setIdentityServerTextFieldText:self.defaultIdentityServerUrl];
|
|
|
|
[self.customServersTickButton setImage:AssetImages.selectionUntick.image forState:UIControlStateNormal];
|
|
self.customServersContainer.hidden = YES;
|
|
|
|
// Refresh content view height
|
|
self.contentViewHeightConstraint.constant -= self.customServersContainer.frame.size.height;
|
|
}
|
|
else
|
|
{
|
|
// Load custom configuration
|
|
NSString *customHomeServerURL = [[NSUserDefaults standardUserDefaults] objectForKey:@"customHomeServerURL"];
|
|
if (customHomeServerURL.length)
|
|
{
|
|
[self setHomeServerTextFieldText:customHomeServerURL];
|
|
}
|
|
else
|
|
{
|
|
[self checkIdentityServer];
|
|
}
|
|
NSString *customIdentityServerURL = [[NSUserDefaults standardUserDefaults] objectForKey:@"customIdentityServerURL"];
|
|
if (customIdentityServerURL.length)
|
|
{
|
|
[self setIdentityServerTextFieldText:customIdentityServerURL];
|
|
}
|
|
|
|
[self.customServersTickButton setImage:AssetImages.selectionTick.image forState:UIControlStateNormal];
|
|
self.customServersContainer.hidden = NO;
|
|
|
|
// Refresh content view height
|
|
[self refreshContentViewHeightConstraint];
|
|
|
|
// Scroll to display server options
|
|
CGPoint offset = self.authenticationScrollView.contentOffset;
|
|
offset.y += self.customServersContainer.frame.size.height;
|
|
self.authenticationScrollView.contentOffset = offset;
|
|
}
|
|
}
|
|
|
|
- (void)saveCustomServerInputs
|
|
{
|
|
NSString *homeServerURL = self.homeServerTextField.text;
|
|
if (homeServerURL.length && ![homeServerURL isEqualToString:self.defaultHomeServerUrl])
|
|
{
|
|
[[NSUserDefaults standardUserDefaults] setObject:homeServerURL forKey:@"customHomeServerURL"];
|
|
}
|
|
else
|
|
{
|
|
[[NSUserDefaults standardUserDefaults] removeObjectForKey:@"customHomeServerURL"];
|
|
}
|
|
|
|
NSString *identityServerURL = self.identityServerTextField.text;
|
|
if (identityServerURL.length && ![identityServerURL isEqualToString:self.defaultIdentityServerUrl])
|
|
{
|
|
[[NSUserDefaults standardUserDefaults] setObject:identityServerURL forKey:@"customIdentityServerURL"];
|
|
}
|
|
else
|
|
{
|
|
[[NSUserDefaults standardUserDefaults] removeObjectForKey:@"customIdentityServerURL"];
|
|
}
|
|
}
|
|
|
|
- (void)showResourceLimitExceededError:(NSDictionary *)errorDict
|
|
{
|
|
MXLogDebug(@"[AuthenticationVC] showResourceLimitExceededError");
|
|
|
|
[self showResourceLimitExceededError:errorDict onAdminContactTapped:^(NSURL *adminContactURL) {
|
|
|
|
[[UIApplication sharedApplication] vc_open:adminContactURL completionHandler:^(BOOL success) {
|
|
if (!success)
|
|
{
|
|
MXLogDebug(@"[AuthenticationVC] adminContact(%@) cannot be opened", adminContactURL);
|
|
}
|
|
}];
|
|
}];
|
|
}
|
|
|
|
#pragma mark - UITextFieldDelegate
|
|
|
|
- (void)textFieldDidBeginEditing:(UITextField *)textField
|
|
{
|
|
[self.authenticationScrollView vc_scrollTo:textField with:UIEdgeInsetsMake(-20, 0, -20, 0) animated:YES];
|
|
}
|
|
|
|
#pragma mark - KVO
|
|
|
|
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
|
|
{
|
|
// Override here the handling of the authInputsView height change.
|
|
if ([@"viewHeightConstraint.constant" isEqualToString:keyPath])
|
|
{
|
|
// Refresh content view height by considering the updated frame of the options container.
|
|
[self refreshContentViewHeightConstraint];
|
|
}
|
|
else if ([@"hidden" isEqualToString:keyPath])
|
|
{
|
|
UIActivityIndicatorView *indicator = (UIActivityIndicatorView*)object;
|
|
[self.authenticationActivityIndicatorContainerView setHidden:indicator.hidden];
|
|
}
|
|
else
|
|
{
|
|
[super observeValueForKeyPath:keyPath ofObject:object change:change context:context];
|
|
}
|
|
}
|
|
|
|
#pragma mark - MXKAuthenticationViewControllerDelegate
|
|
|
|
- (void)authenticationViewController:(MXKAuthenticationViewController *)authenticationViewController didLogWithUserId:(NSString *)userId
|
|
{
|
|
self.userInteractionEnabled = NO;
|
|
[self.authenticationActivityIndicator startAnimating];
|
|
|
|
// Save customized server inputs if used
|
|
if (!self.customServersContainer.isHidden)
|
|
{
|
|
[self saveCustomServerInputs];
|
|
}
|
|
|
|
MXKAccount *account = [[MXKAccountManager sharedManager] accountForUserId:userId];
|
|
MXSession *session = account.mxSession;
|
|
|
|
BOOL botCreationEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:@"enableBotCreation"];
|
|
|
|
// Create DM with Riot-bot on new account creation.
|
|
if (self.authType == MXKAuthenticationTypeRegister && botCreationEnabled)
|
|
{
|
|
MXRoomCreationParameters *roomCreationParameters = [MXRoomCreationParameters parametersForDirectRoomWithUser:@"@riot-bot:matrix.org"];
|
|
[session createRoomWithParameters:roomCreationParameters success:nil failure:^(NSError *error) {
|
|
MXLogDebug(@"[AuthenticationVC] Create chat with riot-bot failed");
|
|
}];
|
|
}
|
|
|
|
// Ask the coordinator to show the loading spinner whilst waiting.
|
|
[self.authVCDelegate authenticationViewController:self
|
|
didLoginWithSession:session
|
|
andPassword:self.authInputsView.password
|
|
orSSOIdentityProvider:self.ssoIdentityProvider];
|
|
}
|
|
|
|
#pragma mark - MXKAuthInputsViewDelegate
|
|
|
|
- (void)authInputsView:(MXKAuthInputsView *)authInputsView presentViewController:(UIViewController*)viewControllerToPresent animated:(BOOL)animated
|
|
{
|
|
[self dismissKeyboard];
|
|
[self presentViewController:viewControllerToPresent animated:animated completion:nil];
|
|
}
|
|
|
|
- (void)authInputsViewDidCancelOperation:(MXKAuthInputsView *)authInputsView
|
|
{
|
|
[self cancel];
|
|
}
|
|
|
|
- (void)authInputsView:(MXKAuthInputsView *)authInputsView autoDiscoverServerWithDomain:(NSString *)domain
|
|
{
|
|
[self tryServerDiscoveryOnDomain:domain];
|
|
}
|
|
|
|
#pragma mark - Server discovery
|
|
|
|
- (void)tryServerDiscoveryOnDomain:(NSString *)domain
|
|
{
|
|
autoDiscovery = [[MXAutoDiscovery alloc] initWithDomain:domain];
|
|
|
|
MXWeakify(self);
|
|
[autoDiscovery findClientConfig:^(MXDiscoveredClientConfig * _Nonnull discoveredClientConfig) {
|
|
MXStrongifyAndReturnIfNil(self);
|
|
|
|
self->autoDiscovery = nil;
|
|
|
|
switch (discoveredClientConfig.action)
|
|
{
|
|
case MXDiscoveredClientConfigActionPrompt:
|
|
[self customiseServersWithWellKnown:discoveredClientConfig.wellKnown];
|
|
break;
|
|
|
|
case MXDiscoveredClientConfigActionFailPrompt:
|
|
case MXDiscoveredClientConfigActionFailError:
|
|
{
|
|
// Alert user
|
|
if (self->alert)
|
|
{
|
|
[self->alert dismissViewControllerAnimated:NO completion:nil];
|
|
}
|
|
|
|
self->alert = [UIAlertController alertControllerWithTitle:[VectorL10n authAutodiscoverInvalidResponse]
|
|
message:nil
|
|
preferredStyle:UIAlertControllerStyleAlert];
|
|
|
|
[self->alert addAction:[UIAlertAction actionWithTitle:[VectorL10n ok]
|
|
style:UIAlertActionStyleDefault
|
|
handler:^(UIAlertAction * action) {
|
|
|
|
self->alert = nil;
|
|
}]];
|
|
|
|
[self presentViewController:self->alert animated:YES completion:nil];
|
|
|
|
break;
|
|
}
|
|
|
|
default:
|
|
// Fail silently
|
|
break;
|
|
}
|
|
|
|
} failure:^(NSError * _Nonnull error) {
|
|
MXStrongifyAndReturnIfNil(self);
|
|
|
|
self->autoDiscovery = nil;
|
|
|
|
// Fail silently
|
|
}];
|
|
}
|
|
|
|
- (void)customiseServersWithWellKnown:(MXWellKnown*)wellKnown
|
|
{
|
|
if (self.customServersContainer.hidden)
|
|
{
|
|
// Check wellKnown data with application default servers
|
|
// If different, use custom servers
|
|
if (![self.defaultHomeServerUrl isEqualToString:wellKnown.homeServer.baseUrl]
|
|
|| ![self.defaultIdentityServerUrl isEqualToString:wellKnown.identityServer.baseUrl])
|
|
{
|
|
[self showCustomHomeserver:wellKnown.homeServer.baseUrl andIdentityServer:wellKnown.identityServer.baseUrl];
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if ([self.defaultHomeServerUrl isEqualToString:wellKnown.homeServer.baseUrl]
|
|
&& [self.defaultIdentityServerUrl isEqualToString:wellKnown.identityServer.baseUrl])
|
|
{
|
|
// wellKnown matches with application default servers
|
|
// Hide custom servers
|
|
[self setCustomServerFieldsVisible:NO];
|
|
}
|
|
else
|
|
{
|
|
NSString *customHomeServerURL = [[NSUserDefaults standardUserDefaults] objectForKey:@"customHomeServerURL"];
|
|
NSString *customIdentityServerURL = [[NSUserDefaults standardUserDefaults] objectForKey:@"customIdentityServerURL"];
|
|
|
|
if (![customHomeServerURL isEqualToString:wellKnown.homeServer.baseUrl]
|
|
|| ![customIdentityServerURL isEqualToString:wellKnown.identityServer.baseUrl])
|
|
{
|
|
// Update custom servers
|
|
[self showCustomHomeserver:wellKnown.homeServer.baseUrl andIdentityServer:wellKnown.identityServer.baseUrl];
|
|
[self setHomeServerTextFieldText:wellKnown.homeServer.baseUrl];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
- (void)showCustomHomeserver:(NSString*)homeserver andIdentityServer:(NSString*)identityServer
|
|
{
|
|
// Store the wellknown data into NSUserDefaults before displaying them
|
|
[[NSUserDefaults standardUserDefaults] setObject:homeserver forKey:@"customHomeServerURL"];
|
|
|
|
if (identityServer)
|
|
{
|
|
[[NSUserDefaults standardUserDefaults] setObject:identityServer forKey:@"customIdentityServerURL"];
|
|
}
|
|
else
|
|
{
|
|
[[NSUserDefaults standardUserDefaults] removeObjectForKey:@"customIdentityServerURL"];
|
|
}
|
|
|
|
// And show custom servers
|
|
[self setCustomServerFieldsVisible:YES];
|
|
}
|
|
|
|
-(void)displayCouldNotVerifyIdentityOfRemoteServer
|
|
{
|
|
__weak typeof(self) weakSelf = self;
|
|
|
|
[self setOnUnrecognizedCertificateBlock:^BOOL(NSData *certificate) {
|
|
|
|
dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
|
|
|
|
NSString *homeserverURL = weakSelf.defaultHomeServerUrl;
|
|
|
|
NSString *title = [VectorL10n sslCouldNotVerify];
|
|
NSString *homeserverURLStr = [VectorL10n sslHomeserverUrl: homeserverURL];
|
|
NSString *fingerprint = [VectorL10n sslFingerprintHash:@"SHA256"];
|
|
NSString *certFingerprint = [certificate mx_SHA256AsHexString];
|
|
|
|
NSString *msg = [NSString stringWithFormat:@"%@\n\n%@\n\n%@\n\n%@\n\n%@\n\n%@",
|
|
[VectorL10n sslCertNotTrust],
|
|
[VectorL10n sslCertNewAccountExpl],
|
|
homeserverURLStr, fingerprint, certFingerprint,
|
|
[VectorL10n sslOnlyAccept]];
|
|
|
|
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:title
|
|
message:msg
|
|
preferredStyle:UIAlertControllerStyleAlert];
|
|
|
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
[weakSelf presentViewController:alertController animated:YES completion:nil];
|
|
});
|
|
|
|
dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER);
|
|
|
|
return false;
|
|
}];
|
|
}
|
|
|
|
#pragma mark - SetPinCoordinatorBridgePresenterDelegate
|
|
|
|
- (void)setPinCoordinatorBridgePresenterDelegateDidComplete:(SetPinCoordinatorBridgePresenter *)coordinatorBridgePresenter
|
|
{
|
|
[coordinatorBridgePresenter dismissWithAnimated:YES completion:nil];
|
|
self.setPinCoordinatorBridgePresenter = nil;
|
|
|
|
[self afterSetPinFlowCompletedWithCredentials:loginCredentials];
|
|
}
|
|
|
|
- (void)setPinCoordinatorBridgePresenterDelegateDidCancel:(SetPinCoordinatorBridgePresenter *)coordinatorBridgePresenter
|
|
{
|
|
// enable the view again
|
|
[self setUserInteractionEnabled:YES];
|
|
|
|
// stop the spinner
|
|
[self.authenticationActivityIndicator stopAnimating];
|
|
|
|
// then, just close the enter pin screen
|
|
[coordinatorBridgePresenter dismissWithAnimated:YES completion:nil];
|
|
self.setPinCoordinatorBridgePresenter = nil;
|
|
}
|
|
|
|
#pragma mark - Social login view management
|
|
|
|
- (BOOL)isSocialLoginViewShown
|
|
{
|
|
return self.socialLoginListView.superview
|
|
&& !self.socialLoginListView.isHidden
|
|
&& self.currentLoginSSOFlow.identityProviders.count;
|
|
}
|
|
|
|
- (CGFloat)socialLoginViewHeightFittingWidth:(CGFloat)width
|
|
{
|
|
NSArray<MXLoginSSOIdentityProvider*> *identityProviders = self.currentLoginSSOFlow.identityProviders;
|
|
|
|
if (!identityProviders.count && self.socialLoginListView)
|
|
{
|
|
return 0.0;
|
|
}
|
|
|
|
return [SocialLoginListView contentViewHeightWithIdentityProviders:identityProviders mode:self.socialLoginListView.mode fitting:self.contentView.frame.size.width];
|
|
}
|
|
|
|
- (void)showSocialLoginViewWithLoginSSOFlow:(MXLoginSSOFlow*)loginSSOFlow andMode:(SocialLoginButtonMode)mode
|
|
{
|
|
SocialLoginListView *listView = self.socialLoginListView;
|
|
|
|
if (!listView)
|
|
{
|
|
listView = [SocialLoginListView instantiate];
|
|
[self.socialLoginContainerView vc_addSubViewMatchingParent:listView];
|
|
self.socialLoginListView = listView;
|
|
listView.delegate = self;
|
|
}
|
|
|
|
[listView updateWith:loginSSOFlow.identityProviders mode:mode];
|
|
|
|
[self refreshContentViewHeightConstraint];
|
|
}
|
|
|
|
- (void)hideSocialLoginView
|
|
{
|
|
[self.socialLoginListView removeFromSuperview];
|
|
[self refreshContentViewHeightConstraint];
|
|
}
|
|
|
|
- (void)updateSocialLoginViewVisibility
|
|
{
|
|
SocialLoginButtonMode socialLoginButtonMode = SocialLoginButtonModeContinue;
|
|
|
|
BOOL showSocialLoginView = BuildSettings.authScreenShowSocialLoginSection && (self.currentLoginSSOFlow ? YES : NO);
|
|
|
|
switch (self.authType)
|
|
{
|
|
case MXKAuthenticationTypeForgotPassword:
|
|
showSocialLoginView = NO;
|
|
break;
|
|
case MXKAuthenticationTypeRegister:
|
|
socialLoginButtonMode = SocialLoginButtonModeSignUp;
|
|
break;
|
|
case MXKAuthenticationTypeLogin:
|
|
if (((AuthInputsView*)self.authInputsView).isSingleSignOnRequired)
|
|
{
|
|
socialLoginButtonMode = SocialLoginButtonModeContinue;
|
|
}
|
|
else
|
|
{
|
|
socialLoginButtonMode = SocialLoginButtonModeSignIn;
|
|
}
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
|
|
if (showSocialLoginView)
|
|
{
|
|
[self showSocialLoginViewWithLoginSSOFlow:self.currentLoginSSOFlow andMode:socialLoginButtonMode];
|
|
}
|
|
else
|
|
{
|
|
[self hideSocialLoginView];
|
|
}
|
|
}
|
|
|
|
#pragma mark - SocialLoginListViewDelegate
|
|
|
|
- (void)socialLoginListView:(SocialLoginListView *)socialLoginListView didTapSocialButtonWithProvider:(SSOIdentityProvider *)identityProvider
|
|
{
|
|
[self presentSSOAuthenticationForIdentityProvider:identityProvider];
|
|
}
|
|
|
|
#pragma mark - SSOIdentityProviderAuthenticationPresenter
|
|
|
|
- (void)presentSSOAuthenticationForIdentityProvider:(SSOIdentityProvider*)identityProvider
|
|
{
|
|
NSString *homeServerStringURL = self.homeServerTextField.text;
|
|
|
|
if (!homeServerStringURL)
|
|
{
|
|
return;
|
|
}
|
|
|
|
SSOAuthenticationService *ssoAuthenticationService = [[SSOAuthenticationService alloc] initWithHomeserverStringURL:homeServerStringURL];
|
|
|
|
SSOAuthenticationPresenter *presenter = [[SSOAuthenticationPresenter alloc] initWithSsoAuthenticationService:ssoAuthenticationService];
|
|
|
|
presenter.delegate = self;
|
|
|
|
// Generate a unique identifier that will identify the success callback URL
|
|
NSString *transactionId = [MXTools generateTransactionId];
|
|
|
|
[presenter presentForIdentityProvider:identityProvider with: transactionId from:self animated:YES];
|
|
|
|
self.ssoCallbackTxnId = transactionId;
|
|
self.ssoAuthenticationPresenter = presenter;
|
|
}
|
|
|
|
- (void)presentDefaultSSOAuthentication
|
|
{
|
|
[self presentSSOAuthenticationForIdentityProvider:nil];
|
|
}
|
|
|
|
- (void)dismissSSOAuthenticationPresenter
|
|
{
|
|
[self.ssoAuthenticationPresenter dismissWithAnimated:YES completion:nil];
|
|
self.ssoAuthenticationPresenter = nil;
|
|
}
|
|
|
|
// TODO: Move to SDK
|
|
- (void)loginWithToken:(NSString*)loginToken
|
|
{
|
|
NSDictionary *parameters = @{
|
|
@"type" : kMXLoginFlowTypeToken,
|
|
@"token": loginToken
|
|
};
|
|
|
|
[self loginWithParameters:parameters];
|
|
}
|
|
|
|
#pragma mark - SSOAuthenticationPresenterDelegate
|
|
|
|
- (void)ssoAuthenticationPresenterDidCancel:(SSOAuthenticationPresenter *)presenter
|
|
{
|
|
[self dismissSSOAuthenticationPresenter];
|
|
}
|
|
|
|
- (void)ssoAuthenticationPresenter:(SSOAuthenticationPresenter *)presenter authenticationDidFailWithError:(NSError *)error
|
|
{
|
|
[self dismissSSOAuthenticationPresenter];
|
|
[self.errorPresenter presentErrorFromViewController:self forError:error animated:YES handler:nil];
|
|
}
|
|
|
|
- (void)ssoAuthenticationPresenter:(SSOAuthenticationPresenter *)presenter
|
|
authenticationSucceededWithToken:(NSString *)token
|
|
usingIdentityProvider:(SSOIdentityProvider * _Nullable)identityProvider
|
|
{
|
|
self.ssoIdentityProvider = identityProvider;
|
|
[self dismissSSOAuthenticationPresenter];
|
|
[self loginWithToken:token];
|
|
}
|
|
|
|
#pragma mark - bwi Extentions
|
|
|
|
// rotermund: As the goal is to be as less invasive as possible, I use the textfields provided by New Vector as business logic. To make this look nicer I would have to make changes in e.g. updateRestClient
|
|
|
|
- (void) enableTestServerControl {
|
|
for (UIView *view in self.customServersContainer.subviews) {
|
|
view.hidden = YES;
|
|
}
|
|
self.customServersTickButton.hidden = YES;
|
|
self.customServersContainer.hidden = NO;
|
|
|
|
if (@available(iOS 14.0, *)) {
|
|
self.bwServerOptionsLabel = [[UILabel alloc] initWithFrame:CGRectMake(40, 60, 200, 30)];
|
|
self.bwServerOptionsLabel.text = NSLocalizedStringFromTable(@"bwi_auth_beta_selection_title", @"Bwi", nil);
|
|
// [self.customServersContainer addSubview:self.bwServerOptionsLabel];
|
|
|
|
self.homeServerTextField = [self serverSelectionTextField];
|
|
|
|
self.bwServerPreSelectionButton = [self serverSelectionButton];
|
|
[self.customServersContainer addSubview:self.bwServerPreSelectionButton];
|
|
} else {
|
|
NSArray *itemArray = [NSArray arrayWithObjects: @"Produktion", @"MSG", @"UAT", nil];
|
|
|
|
self.bwServerOptionsControl = [[UISegmentedControl alloc] initWithItems:itemArray];
|
|
self.bwServerOptionsControl.frame = CGRectMake(40, 90, self.customServersContainer.frame.size.width-80, 30);
|
|
[self.bwServerOptionsControl addTarget:self action:@selector(serverOptionsControlChanged:) forControlEvents: UIControlEventValueChanged];
|
|
self.bwServerOptionsControl.selectedSegmentIndex = 0;
|
|
|
|
[self.customServersContainer addSubview:self.bwServerOptionsControl];
|
|
|
|
self.bwServerOptionsLabel = [[UILabel alloc] initWithFrame:CGRectMake(40, 60, 200, 30)];
|
|
self.bwServerOptionsLabel.text = NSLocalizedStringFromTable(@"bwi_auth_beta_selection_title", @"Bwi", nil);
|
|
// [self.customServersContainer addSubview:self.bwServerOptionsLabel];
|
|
self.customServersContainer.hidden = NO;
|
|
}
|
|
}
|
|
|
|
- (void) enableRegisterButton {
|
|
self.bwRegisterButton = [UIButton buttonWithType:UIButtonTypeSystem];
|
|
|
|
NSMutableParagraphStyle * paragraphStyle = [[NSMutableParagraphStyle alloc] init];
|
|
paragraphStyle.alignment = NSTextAlignmentCenter;
|
|
NSMutableAttributedString *registerString = [[NSMutableAttributedString alloc] initWithString:NSLocalizedStringFromTable(@"bwi_auth_register_button_title", @"Vector", nil) attributes: @{NSParagraphStyleAttributeName:paragraphStyle}];
|
|
[registerString addAttribute:NSUnderlineStyleAttributeName value:[NSNumber numberWithInteger:NSUnderlineStyleSingle] range:NSMakeRange(0, [registerString length])];
|
|
|
|
[self.bwRegisterButton setAttributedTitle:registerString forState:UIControlStateNormal];
|
|
[self.bwRegisterButton setTitleColor:ThemeService.shared.theme.tintColor forState:UIControlStateNormal];
|
|
|
|
[self.bwRegisterButton addTarget:self action:@selector(bwiOnRegisterButtonPressed:) forControlEvents:UIControlEventTouchUpInside];
|
|
|
|
[self.optionsContainer addSubview:self.bwRegisterButton];
|
|
[self.optionsContainer bringSubviewToFront:self.bwRegisterButton];
|
|
}
|
|
|
|
- (UITextField*)serverSelectionTextField {
|
|
UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(40, 90, self.customServersContainer.frame.size.width-80, 30)];
|
|
textField.text = BuildSettings.serverConfigPreSelections[@"Prod"];
|
|
textField.borderStyle = UITextBorderStyleRoundedRect;
|
|
textField.font = [UIFont systemFontOfSize:15];
|
|
textField.placeholder = @"enter text";
|
|
textField.autocorrectionType = UITextAutocorrectionTypeNo;
|
|
textField.keyboardType = UIKeyboardTypeDefault;
|
|
textField.returnKeyType = UIReturnKeyDone;
|
|
textField.clearButtonMode = UITextFieldViewModeWhileEditing;
|
|
textField.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
|
|
textField.delegate = self;
|
|
|
|
[self.customServersContainer addSubview:textField];
|
|
|
|
return textField;
|
|
}
|
|
|
|
- (UIButton*)serverSelectionButton {
|
|
|
|
if (@available(iOS 14.0, *)) {
|
|
NSMutableArray* actions = [[NSMutableArray alloc] init];
|
|
|
|
for (ServerSetting* setting in ServerURLHelper.shared.serverSettings) {
|
|
[actions addObject:[UIAction actionWithTitle:setting.name image:nil identifier:nil handler:^(__kindof UIAction* _Nonnull action) {
|
|
[self setHomeServerTextFieldText:setting.serverUrl];
|
|
}]];
|
|
}
|
|
|
|
UIMenu* menu = [UIMenu menuWithChildren:actions];
|
|
|
|
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
|
|
button.menu = menu;
|
|
button.showsMenuAsPrimaryAction = true;
|
|
|
|
button.frame = CGRectMake(40, 120, self.customServersContainer.frame.size.width-80, 30);
|
|
[button setTitle:NSLocalizedStringFromTable(@"bwi_auth_beta_selection_button_title", @"Bwi", nil) forState:UIControlStateNormal];
|
|
button.titleLabel.textColor = ThemeService.shared.theme.textPrimaryColor;
|
|
button.backgroundColor = ThemeService.shared.theme.tintColor;
|
|
|
|
return button;
|
|
} else {
|
|
return nil;
|
|
}
|
|
}
|
|
|
|
- (void)serverOptionsControlChanged:(UISegmentedControl *)segment
|
|
{
|
|
|
|
switch (segment.selectedSegmentIndex) {
|
|
case 0:
|
|
[self setHomeServerTextFieldText:BuildSettings.serverConfigPreSelections[@"Prod"]];
|
|
[self setHomeServerTextFieldText:BuildSettings.serverConfigPreSelections[@"Prod"]];
|
|
break;
|
|
case 1:
|
|
[self setHomeServerTextFieldText:BuildSettings.serverConfigPreSelections[@"MSGDemo"]];
|
|
[self setHomeServerTextFieldText:BuildSettings.serverConfigPreSelections[@"MSGDemo"]];
|
|
break;
|
|
case 2:
|
|
[self setHomeServerTextFieldText:BuildSettings.serverConfigPreSelections[@"UAT"]];
|
|
[self setHomeServerTextFieldText:BuildSettings.serverConfigPreSelections[@"UAT"]];
|
|
break;
|
|
case 3:
|
|
[self setHomeServerTextFieldText:BuildSettings.serverConfigPreSelections[@"Lab23"]];
|
|
[self setHomeServerTextFieldText:BuildSettings.serverConfigPreSelections[@"Lab23"]];
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
}
|
|
|
|
- (void) bwiOnRegisterButtonPressed:(id)sender {
|
|
[self bwiPresentRegisterInformationAlert];
|
|
}
|
|
|
|
- (void) bwiPresentRegisterInformationAlert
|
|
{
|
|
UIAlertController *alert = [UIAlertController alertControllerWithTitle:NSLocalizedStringFromTable(@"bwi_auth_register_alert_title", @"Vector", nil)
|
|
message:NSLocalizedStringFromTable(@"bwi_auth_register_alert_text", @"Vector", nil)
|
|
preferredStyle:UIAlertControllerStyleAlert];
|
|
[alert addAction:[UIAlertAction actionWithTitle:[VectorL10n ok] style:UIAlertActionStyleDefault handler:nil]];
|
|
[self presentViewController:alert animated:YES completion:nil];
|
|
}
|
|
|
|
@end
|