From 4fe023daee8cf8e8728ec5c31bb6225fadaa7d30 Mon Sep 17 00:00:00 2001 From: Doug Date: Thu, 10 Mar 2022 11:28:03 +0000 Subject: [PATCH 1/8] Fix social button visibility during registration Hide the back button at the same time. Disable custom server entry when picking a different use case. --- .../Authentication/AuthenticationCoordinator.swift | 11 +++++++---- .../AuthenticationCoordinatorProtocol.swift | 6 +++--- .../Authentication/AuthenticationViewController.m | 12 +++++++++++- Riot/Modules/Onboarding/OnboardingCoordinator.swift | 4 +--- changelog.d/5879.bugfix | 1 + 5 files changed, 23 insertions(+), 11 deletions(-) create mode 100644 changelog.d/5879.bugfix diff --git a/Riot/Modules/Authentication/AuthenticationCoordinator.swift b/Riot/Modules/Authentication/AuthenticationCoordinator.swift index f9d8787aa..e452d8529 100644 --- a/Riot/Modules/Authentication/AuthenticationCoordinator.swift +++ b/Riot/Modules/Authentication/AuthenticationCoordinator.swift @@ -43,6 +43,13 @@ final class AuthenticationCoordinator: NSObject, AuthenticationCoordinatorProtoc var childCoordinators: [Coordinator] = [] var completion: ((AuthenticationCoordinatorResult) -> Void)? + var customServerFieldsVisible = false { + didSet { + guard customServerFieldsVisible != oldValue else { return } + authenticationViewController.setCustomServerFieldsVisible(customServerFieldsVisible) + } + } + // MARK: - Setup init(parameters: AuthenticationCoordinatorParameters) { @@ -74,10 +81,6 @@ final class AuthenticationCoordinator: NSObject, AuthenticationCoordinatorProtoc authenticationViewController.authType = authenticationType } - func showCustomServer() { - authenticationViewController.setCustomServerFieldsVisible(true) - } - func update(externalRegistrationParameters: [AnyHashable: Any]) { authenticationViewController.externalRegistrationParameters = externalRegistrationParameters } diff --git a/Riot/Modules/Authentication/AuthenticationCoordinatorProtocol.swift b/Riot/Modules/Authentication/AuthenticationCoordinatorProtocol.swift index f04676861..54696e503 100644 --- a/Riot/Modules/Authentication/AuthenticationCoordinatorProtocol.swift +++ b/Riot/Modules/Authentication/AuthenticationCoordinatorProtocol.swift @@ -36,12 +36,12 @@ enum AuthenticationCoordinatorResult { protocol AuthenticationCoordinatorProtocol: Coordinator, Presentable { var completion: ((AuthenticationCoordinatorResult) -> Void)? { get set } + /// Whether the custom homeserver checkbox is enabled for the user to enter a homeserver URL. + var customServerFieldsVisible: Bool { get set } + /// Update the screen to display registration or login. func update(authenticationType: MXKAuthenticationType) - /// Enable the custom server checkbox to allow the user to enter a homeserver URL. - func showCustomServer() - /// Force a registration process based on a predefined set of parameters from a server provisioning link. /// For more information see `AuthenticationViewController.externalRegistrationParameters`. func update(externalRegistrationParameters: [AnyHashable: Any]) diff --git a/Riot/Modules/Authentication/AuthenticationViewController.m b/Riot/Modules/Authentication/AuthenticationViewController.m index 449276f09..448d75b8b 100644 --- a/Riot/Modules/Authentication/AuthenticationViewController.m +++ b/Riot/Modules/Authentication/AuthenticationViewController.m @@ -504,6 +504,7 @@ static const CGFloat kAuthInputContainerViewMinHeightConstraintConstant = 150.0; // Remove the potential back button. self.navigationItem.leftBarButtonItem = nil; + [self.navigationItem setHidesBackButton:YES]; } else { @@ -903,6 +904,12 @@ static const CGFloat kAuthInputContainerViewMinHeightConstraintConstant = 150.0; 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) @@ -947,7 +954,10 @@ static const CGFloat kAuthInputContainerViewMinHeightConstraintConstant = 150.0; 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]; diff --git a/Riot/Modules/Onboarding/OnboardingCoordinator.swift b/Riot/Modules/Onboarding/OnboardingCoordinator.swift index 94182fa56..dd2a379ba 100644 --- a/Riot/Modules/Onboarding/OnboardingCoordinator.swift +++ b/Riot/Modules/Onboarding/OnboardingCoordinator.swift @@ -215,9 +215,7 @@ final class OnboardingCoordinator: NSObject, OnboardingCoordinatorProtocol { coordinator.update(externalRegistrationParameters: externalRegistrationParameters) } - if useCaseResult == .customServer { - coordinator.showCustomServer() - } + coordinator.customServerFieldsVisible = useCaseResult == .customServer if let softLogoutCredentials = parameters.softLogoutCredentials { coordinator.update(softLogoutCredentials: softLogoutCredentials) diff --git a/changelog.d/5879.bugfix b/changelog.d/5879.bugfix new file mode 100644 index 000000000..68a575622 --- /dev/null +++ b/changelog.d/5879.bugfix @@ -0,0 +1 @@ +Authentication: Fix social login buttons visibility during registration flow and other minor navigation tweaks. \ No newline at end of file From 902a227e8d57e6908e7bfc5b4d4ed5dcc347174c Mon Sep 17 00:00:00 2001 From: Andy Uhnak Date: Thu, 10 Mar 2022 15:33:50 +0000 Subject: [PATCH 2/8] Do not show user indicators when the view controller is not visible --- .../UserIndicatorPresenterWrapper.swift | 2 ++ .../Modules/Common/Recents/RecentsViewController.m | 11 +++++++++-- Riot/Modules/Room/RoomViewController.m | 14 ++++++++++++-- changelog.d/5801.bugfix | 1 + 4 files changed, 24 insertions(+), 4 deletions(-) create mode 100644 changelog.d/5801.bugfix diff --git a/Riot/Modules/Common/ActivityIndicator/UserIndicatorPresenterWrapper.swift b/Riot/Modules/Common/ActivityIndicator/UserIndicatorPresenterWrapper.swift index f7faa03f6..a4ae0d44e 100644 --- a/Riot/Modules/Common/ActivityIndicator/UserIndicatorPresenterWrapper.swift +++ b/Riot/Modules/Common/ActivityIndicator/UserIndicatorPresenterWrapper.swift @@ -41,10 +41,12 @@ import CommonKit return } + MXLog.debug("[UserIndicatorPresenterWrapper] Present loading indicator") loadingIndicator = presenter.present(.loading(label: label, isInteractionBlocking: false)) } @objc func dismissActivityIndicator() { + MXLog.debug("[UserIndicatorPresenterWrapper] Dismiss loading indicator") loadingIndicator = nil } diff --git a/Riot/Modules/Common/Recents/RecentsViewController.m b/Riot/Modules/Common/Recents/RecentsViewController.m index 99c348b1c..7d4336ebf 100644 --- a/Riot/Modules/Common/Recents/RecentsViewController.m +++ b/Riot/Modules/Common/Recents/RecentsViewController.m @@ -64,6 +64,10 @@ NSString *const RecentsViewControllerDataReadyNotification = @"RecentsViewContro // when the user selects it. UISearchBar *tableSearchBar; + // Flag determining whether the view controller is ready to use (potentially shared) user indicators + // depending on whether the controller is visible or not + BOOL isUserIndicatorEnabled; + // Observe kThemeServiceDidChangeThemeNotification to handle user interface theme change. __weak id kThemeServiceDidChangeThemeNotificationObserver; } @@ -266,6 +270,8 @@ NSString *const RecentsViewControllerDataReadyNotification = @"RecentsViewContro [super viewWillAppear:animated]; [self.screenTracker trackScreen]; + + isUserIndicatorEnabled = YES; // Reset back user interactions self.userInteractionEnabled = YES; @@ -317,6 +323,7 @@ NSString *const RecentsViewControllerDataReadyNotification = @"RecentsViewContro kMXNotificationCenterDidUpdateRulesObserver = nil; } + isUserIndicatorEnabled = NO; [self stopActivityIndicator]; } @@ -2408,7 +2415,7 @@ NSString *const RecentsViewControllerDataReadyNotification = @"RecentsViewContro } - (void)startActivityIndicatorWithLabel:(NSString *)label { - if (self.indicatorPresenter) { + if (self.indicatorPresenter && isUserIndicatorEnabled) { [self.indicatorPresenter presentActivityIndicatorWithLabel:label]; } else { [super startActivityIndicator]; @@ -2416,7 +2423,7 @@ NSString *const RecentsViewControllerDataReadyNotification = @"RecentsViewContro } - (void)startActivityIndicator { - if (self.indicatorPresenter) { + if (self.indicatorPresenter && isUserIndicatorEnabled) { [self.indicatorPresenter presentActivityIndicator]; } else { [super startActivityIndicator]; diff --git a/Riot/Modules/Room/RoomViewController.m b/Riot/Modules/Room/RoomViewController.m index 8288c6f81..296585b96 100644 --- a/Riot/Modules/Room/RoomViewController.m +++ b/Riot/Modules/Room/RoomViewController.m @@ -567,7 +567,9 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05; isAppeared = NO; [VoiceMessageMediaServiceProvider.sharedProvider pauseAllServices]; - [self stopActivityIndicator]; + + // Stop the loading indicator even if the session is still in progress + [self stopLoadingIndicator]; } - (void)viewDidAppear:(BOOL)animated @@ -956,14 +958,22 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05; notificationTaskProfile = nil; } if ([self providesCustomActivityIndicator]) { + // The legacy super implementation of `stopActivityIndicator` contains a number of checks grouped under `canStopActivityIndicator` + // to determine whether the indicator can be stopped or not (and the method should thus rather be called `stopActivityIndicatorIfPossible`). + // Since the newer indicators are not calling super implementation, the check for `canStopActivityIndicator` has to be performed manually. if ([self canStopActivityIndicator]) { - [self.delegate roomViewControllerDidStopLoading:self]; + [self stopLoadingIndicator]; } } else { [super stopActivityIndicator]; } } +- (void)stopLoadingIndicator +{ + [self.delegate roomViewControllerDidStopLoading:self]; +} + - (void)displayRoom:(MXKRoomDataSource *)dataSource { // Remove potential preview Data diff --git a/changelog.d/5801.bugfix b/changelog.d/5801.bugfix new file mode 100644 index 000000000..3d58e1ee8 --- /dev/null +++ b/changelog.d/5801.bugfix @@ -0,0 +1 @@ +Activity Indicators: Do not show user indicators when the view controller is not visible From 0fed5c6a73337a2e30271bb433440aecfd8d00b4 Mon Sep 17 00:00:00 2001 From: Andy Uhnak Date: Thu, 10 Mar 2022 17:32:25 +0000 Subject: [PATCH 3/8] Name changes --- .../UserIndicatorPresenterWrapper.swift | 10 +++++----- .../Common/Recents/RecentsViewController.m | 20 +++++++++---------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/Riot/Modules/Common/ActivityIndicator/UserIndicatorPresenterWrapper.swift b/Riot/Modules/Common/ActivityIndicator/UserIndicatorPresenterWrapper.swift index a4ae0d44e..7d1bd9d3b 100644 --- a/Riot/Modules/Common/ActivityIndicator/UserIndicatorPresenterWrapper.swift +++ b/Riot/Modules/Common/ActivityIndicator/UserIndicatorPresenterWrapper.swift @@ -30,13 +30,13 @@ import CommonKit self.presenter = presenter } - @objc func presentActivityIndicator() { - presentActivityIndicator(label: VectorL10n.homeSyncing) + @objc func presentLoadingIndicator() { + presentLoadingIndicator(label: VectorL10n.homeSyncing) } - @objc func presentActivityIndicator(label: String) { + @objc func presentLoadingIndicator(label: String) { guard loadingIndicator == nil else { - // The app is very liberal with calling `presentActivityIndicator` (often not matched by corresponding `removeCurrentActivityIndicator`), + // The app is very liberal with calling `presentLoadingIndicator` (often not matched by corresponding `dismissLoadingIndicator`), // so there is no reason to keep adding new indiciators if there is one already showing. return } @@ -45,7 +45,7 @@ import CommonKit loadingIndicator = presenter.present(.loading(label: label, isInteractionBlocking: false)) } - @objc func dismissActivityIndicator() { + @objc func dismissLoadingIndicator() { MXLog.debug("[UserIndicatorPresenterWrapper] Dismiss loading indicator") loadingIndicator = nil } diff --git a/Riot/Modules/Common/Recents/RecentsViewController.m b/Riot/Modules/Common/Recents/RecentsViewController.m index 7d4336ebf..dab50e315 100644 --- a/Riot/Modules/Common/Recents/RecentsViewController.m +++ b/Riot/Modules/Common/Recents/RecentsViewController.m @@ -64,9 +64,8 @@ NSString *const RecentsViewControllerDataReadyNotification = @"RecentsViewContro // when the user selects it. UISearchBar *tableSearchBar; - // Flag determining whether the view controller is ready to use (potentially shared) user indicators - // depending on whether the controller is visible or not - BOOL isUserIndicatorEnabled; + // Flag indicating whether the view controller is (at least partially) visible and not dissapearing + BOOL isViewVisible; // Observe kThemeServiceDidChangeThemeNotification to handle user interface theme change. __weak id kThemeServiceDidChangeThemeNotificationObserver; @@ -268,10 +267,9 @@ NSString *const RecentsViewControllerDataReadyNotification = @"RecentsViewContro - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; + isViewVisible = YES; [self.screenTracker trackScreen]; - - isUserIndicatorEnabled = YES; // Reset back user interactions self.userInteractionEnabled = YES; @@ -307,6 +305,7 @@ NSString *const RecentsViewControllerDataReadyNotification = @"RecentsViewContro - (void)viewWillDisappear:(BOOL)animated { [super viewWillDisappear:animated]; + isViewVisible = NO; // Leave potential editing mode [self cancelEditionMode:NO]; @@ -323,7 +322,6 @@ NSString *const RecentsViewControllerDataReadyNotification = @"RecentsViewContro kMXNotificationCenterDidUpdateRulesObserver = nil; } - isUserIndicatorEnabled = NO; [self stopActivityIndicator]; } @@ -2415,16 +2413,16 @@ NSString *const RecentsViewControllerDataReadyNotification = @"RecentsViewContro } - (void)startActivityIndicatorWithLabel:(NSString *)label { - if (self.indicatorPresenter && isUserIndicatorEnabled) { - [self.indicatorPresenter presentActivityIndicatorWithLabel:label]; + if (self.indicatorPresenter && isViewVisible) { + [self.indicatorPresenter presentLoadingIndicatorWithLabel:label]; } else { [super startActivityIndicator]; } } - (void)startActivityIndicator { - if (self.indicatorPresenter && isUserIndicatorEnabled) { - [self.indicatorPresenter presentActivityIndicator]; + if (self.indicatorPresenter && isViewVisible) { + [self.indicatorPresenter presentLoadingIndicator]; } else { [super startActivityIndicator]; } @@ -2432,7 +2430,7 @@ NSString *const RecentsViewControllerDataReadyNotification = @"RecentsViewContro - (void)stopActivityIndicator { if (self.indicatorPresenter) { - [self.indicatorPresenter dismissActivityIndicator]; + [self.indicatorPresenter dismissLoadingIndicator]; } else { [super stopActivityIndicator]; } From 18d0ccf6b71b65c903e76548155e9c6296e22af8 Mon Sep 17 00:00:00 2001 From: Andy Uhnak Date: Thu, 10 Mar 2022 17:40:23 +0000 Subject: [PATCH 4/8] Add more comments --- Riot/Modules/Room/RoomViewController.m | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Riot/Modules/Room/RoomViewController.m b/Riot/Modules/Room/RoomViewController.m index 296585b96..ffe224ede 100644 --- a/Riot/Modules/Room/RoomViewController.m +++ b/Riot/Modules/Room/RoomViewController.m @@ -569,7 +569,7 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05; [VoiceMessageMediaServiceProvider.sharedProvider pauseAllServices]; // Stop the loading indicator even if the session is still in progress - [self stopLoadingIndicator]; + [self stopLoadingUserIndicator]; } - (void)viewDidAppear:(BOOL)animated @@ -937,10 +937,14 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05; self.updateRoomReadMarker = NO; } +#pragma mark - Loading indicators + - (BOOL)providesCustomActivityIndicator { return [self.delegate roomViewControllerCanDelegateUserIndicators:self]; } +// Override of a legacy method to determine whether to use a newer implementation instead. +// Will be removed in the future https://github.com/vector-im/element-ios/issues/5608 - (void)startActivityIndicator { if ([self providesCustomActivityIndicator]) { [self.delegate roomViewControllerDidStartLoading:self]; @@ -949,6 +953,8 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05; } } +// Override of a legacy method to determine whether to use a newer implementation instead. +// Will be removed in the future https://github.com/vector-im/element-ios/issues/5608 - (void)stopActivityIndicator { if (notificationTaskProfile) @@ -962,14 +968,14 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05; // to determine whether the indicator can be stopped or not (and the method should thus rather be called `stopActivityIndicatorIfPossible`). // Since the newer indicators are not calling super implementation, the check for `canStopActivityIndicator` has to be performed manually. if ([self canStopActivityIndicator]) { - [self stopLoadingIndicator]; + [self stopLoadingUserIndicator]; } } else { [super stopActivityIndicator]; } } -- (void)stopLoadingIndicator +- (void)stopLoadingUserIndicator { [self.delegate roomViewControllerDidStopLoading:self]; } From e0adc29903edc7d276ec68988408745ca69d5b8b Mon Sep 17 00:00:00 2001 From: Andy Uhnak Date: Fri, 11 Mar 2022 13:15:20 +0000 Subject: [PATCH 5/8] Ignore the sender of a room invite without needing to join the room first --- Riot/Assets/en.lproj/Vector.strings | 2 ++ Riot/Generated/Strings.swift | 8 +++++ Riot/Modules/Room/RoomViewController.m | 50 ++++++++++++++++++++++---- changelog.d/5807.change | 1 + 4 files changed, 54 insertions(+), 7 deletions(-) create mode 100644 changelog.d/5807.change diff --git a/Riot/Assets/en.lproj/Vector.strings b/Riot/Assets/en.lproj/Vector.strings index ef355b183..9d6727dbb 100644 --- a/Riot/Assets/en.lproj/Vector.strings +++ b/Riot/Assets/en.lproj/Vector.strings @@ -497,6 +497,7 @@ Tap the + to start adding people."; "room_preview_unlinked_email_warning" = "This invitation was sent to %@, which is not associated with this account. You may wish to login with a different account, or add this email to your account."; "room_preview_try_join_an_unknown_room" = "You are trying to access %@. Would you like to join in order to participate in the discussion?"; "room_preview_try_join_an_unknown_room_default" = "a room"; +"room_preview_decline_invitation_options" = "Do you want to decline the invitation or ignore this user?"; // Settings "settings_title" = "Settings"; @@ -2032,6 +2033,7 @@ Tap the + to start adding people."; "end_call" = "End Call"; "resume_call" = "Resume"; "ignore" = "Ignore"; +"ignore_user" = "Ignore User"; "unignore" = "Unignore"; // Events formatter diff --git a/Riot/Generated/Strings.swift b/Riot/Generated/Strings.swift index 755555512..cf2c25d68 100644 --- a/Riot/Generated/Strings.swift +++ b/Riot/Generated/Strings.swift @@ -2127,6 +2127,10 @@ public class VectorL10n: NSObject { public static var ignore: String { return VectorL10n.tr("Vector", "ignore") } + /// Ignore User + public static var ignoreUser: String { + return VectorL10n.tr("Vector", "ignore_user") + } /// Take photo public static var imagePickerActionCamera: String { return VectorL10n.tr("Vector", "image_picker_action_camera") @@ -5323,6 +5327,10 @@ public class VectorL10n: NSObject { public static var roomPredecessorLink: String { return VectorL10n.tr("Vector", "room_predecessor_link") } + /// Do you want to decline the invitation or ignore this user? + public static var roomPreviewDeclineInvitationOptions: String { + return VectorL10n.tr("Vector", "room_preview_decline_invitation_options") + } /// You have been invited to join this room by %@ public static func roomPreviewInvitationFormat(_ p1: String) -> String { return VectorL10n.tr("Vector", "room_preview_invitation_format", p1) diff --git a/Riot/Modules/Room/RoomViewController.m b/Riot/Modules/Room/RoomViewController.m index ffe224ede..28431729c 100644 --- a/Riot/Modules/Room/RoomViewController.m +++ b/Riot/Modules/Room/RoomViewController.m @@ -4979,10 +4979,31 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05; } else if (tappedView == previewHeader.leftButton) { - [self declineRoomInvitation]; + [self presentDeclineOptions]; } } +- (void)presentDeclineOptions +{ + UIAlertController *actionSheet = [UIAlertController alertControllerWithTitle:[VectorL10n roomPreviewDeclineInvitationOptions] + message:nil + preferredStyle:UIAlertControllerStyleActionSheet]; + [actionSheet addAction:[UIAlertAction actionWithTitle:[VectorL10n decline] + style:UIAlertActionStyleDefault + handler:^(UIAlertAction * _Nonnull action) { + [self declineRoomInvitation]; + }]]; + [actionSheet addAction:[UIAlertAction actionWithTitle:[VectorL10n ignoreUser] + style:UIAlertActionStyleDestructive + handler:^(UIAlertAction * _Nonnull action) { + [self ignoreInviteSender]; + }]]; + [actionSheet addAction:[UIAlertAction actionWithTitle:[VectorL10n cancel] + style:UIAlertActionStyleCancel + handler:nil]]; + [self presentViewController:actionSheet animated:YES completion:nil]; +} + - (void)declineRoomInvitation { // 'Decline' button has been pressed @@ -4993,14 +5014,9 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05; else { [self startActivityIndicator]; - [self.roomDataSource.room leave:^{ - [self stopActivityIndicator]; - - // We remove the current view controller. - // Pop to homes view controller - [[AppDelegate theDelegate] restoreInitialDisplay:^{}]; + [self popToHomeViewController]; } failure:^(NSError *error) { @@ -5011,6 +5027,26 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05; } } +- (void)ignoreInviteSender +{ + [self startActivityIndicator]; + [self.roomDataSource.room ignoreInviteSender:^{ + [self stopActivityIndicator]; + [self popToHomeViewController]; + + } failure:^(NSError *error) { + [self stopActivityIndicator]; + MXLogDebug(@"[RoomVC] Failed to ignore inviter in room (%@)", self.roomDataSource.room.roomId); + }]; +} + +- (void)popToHomeViewController +{ + // We remove the current view controller. + // Pop to homes view controller + [[AppDelegate theDelegate] restoreInitialDisplay:^{}]; +} + #pragma mark - Typing management - (void)removeTypingNotificationsListener diff --git a/changelog.d/5807.change b/changelog.d/5807.change new file mode 100644 index 000000000..fa2b13524 --- /dev/null +++ b/changelog.d/5807.change @@ -0,0 +1 @@ +Room: Ignore the sender of a room invite without needing to join the room first From 9751d22772008fe8f55ae526fab0aa0331c6d883 Mon Sep 17 00:00:00 2001 From: Andy Uhnak Date: Mon, 14 Mar 2022 08:47:52 +0000 Subject: [PATCH 6/8] Anchor action sheet to source view --- Riot/Modules/Room/RoomViewController.m | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Riot/Modules/Room/RoomViewController.m b/Riot/Modules/Room/RoomViewController.m index 28431729c..d8a02a9ae 100644 --- a/Riot/Modules/Room/RoomViewController.m +++ b/Riot/Modules/Room/RoomViewController.m @@ -4979,11 +4979,11 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05; } else if (tappedView == previewHeader.leftButton) { - [self presentDeclineOptions]; + [self presentDeclineOptionsFromView:tappedView]; } } -- (void)presentDeclineOptions +- (void)presentDeclineOptionsFromView:(UIView *)view { UIAlertController *actionSheet = [UIAlertController alertControllerWithTitle:[VectorL10n roomPreviewDeclineInvitationOptions] message:nil @@ -5001,6 +5001,7 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05; [actionSheet addAction:[UIAlertAction actionWithTitle:[VectorL10n cancel] style:UIAlertActionStyleCancel handler:nil]]; + actionSheet.popoverPresentationController.sourceView = view; [self presentViewController:actionSheet animated:YES completion:nil]; } @@ -5014,11 +5015,15 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05; else { [self startActivityIndicator]; + MXWeakify(self); [self.roomDataSource.room leave:^{ + MXStrongifyAndReturnIfNil(self); + [self stopActivityIndicator]; [self popToHomeViewController]; } failure:^(NSError *error) { + MXStrongifyAndReturnIfNil(self); [self stopActivityIndicator]; MXLogDebug(@"[RoomVC] Failed to reject an invited room (%@) failed", self.roomDataSource.room.roomId); @@ -5030,11 +5035,16 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05; - (void)ignoreInviteSender { [self startActivityIndicator]; + MXWeakify(self); [self.roomDataSource.room ignoreInviteSender:^{ + MXStrongifyAndReturnIfNil(self); + [self stopActivityIndicator]; [self popToHomeViewController]; } failure:^(NSError *error) { + MXStrongifyAndReturnIfNil(self); + [self stopActivityIndicator]; MXLogDebug(@"[RoomVC] Failed to ignore inviter in room (%@)", self.roomDataSource.room.roomId); }]; From 0b148bffafc7984bd9b9080fbe888b474311a6da Mon Sep 17 00:00:00 2001 From: Andy Uhnak Date: Mon, 14 Mar 2022 15:45:54 +0000 Subject: [PATCH 7/8] changelog.d: Upgrade MatrixSDK version ([v0.22.6](https://github.com/matrix-org/matrix-ios-sdk/releases/tag/v0.22.6)). --- Config/AppVersion.xcconfig | 4 ++-- Podfile | 2 +- changelog.d/x-nolink-0.change | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 changelog.d/x-nolink-0.change diff --git a/Config/AppVersion.xcconfig b/Config/AppVersion.xcconfig index b0402b34e..174e0bd5b 100644 --- a/Config/AppVersion.xcconfig +++ b/Config/AppVersion.xcconfig @@ -15,5 +15,5 @@ // // Version -MARKETING_VERSION = 1.8.5 -CURRENT_PROJECT_VERSION = 1.8.5 +MARKETING_VERSION = 1.8.6 +CURRENT_PROJECT_VERSION = 1.8.6 diff --git a/Podfile b/Podfile index 67f463d93..07fe178d6 100644 --- a/Podfile +++ b/Podfile @@ -13,7 +13,7 @@ use_frameworks! # - `{ :specHash => {sdk spec hash}` to depend on specific pod options (:git => …, :podspec => …) for MatrixSDK repo. Used by Fastfile during CI # # Warning: our internal tooling depends on the name of this variable name, so be sure not to change it -$matrixSDKVersion = '= 0.22.5' +$matrixSDKVersion = '= 0.22.6' # $matrixSDKVersion = :local # $matrixSDKVersion = { :branch => 'develop'} # $matrixSDKVersion = { :specHash => { git: 'https://git.io/fork123', branch: 'fix' } } diff --git a/changelog.d/x-nolink-0.change b/changelog.d/x-nolink-0.change new file mode 100644 index 000000000..f11ebf15e --- /dev/null +++ b/changelog.d/x-nolink-0.change @@ -0,0 +1 @@ +Upgrade MatrixSDK version ([v0.22.6](https://github.com/matrix-org/matrix-ios-sdk/releases/tag/v0.22.6)). \ No newline at end of file From ab9cf598af4d265fe3959921747e545512cd53e1 Mon Sep 17 00:00:00 2001 From: Andy Uhnak Date: Mon, 14 Mar 2022 15:45:55 +0000 Subject: [PATCH 8/8] version++ --- CHANGES.md | 13 +++++++++++++ changelog.d/5801.bugfix | 1 - changelog.d/5807.change | 1 - changelog.d/5879.bugfix | 1 - changelog.d/x-nolink-0.change | 1 - 5 files changed, 13 insertions(+), 4 deletions(-) delete mode 100644 changelog.d/5801.bugfix delete mode 100644 changelog.d/5807.change delete mode 100644 changelog.d/5879.bugfix delete mode 100644 changelog.d/x-nolink-0.change diff --git a/CHANGES.md b/CHANGES.md index 717770810..53b527969 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,16 @@ +## Changes in 1.8.6 (2022-03-14) + +🙌 Improvements + +- Upgrade MatrixSDK version ([v0.22.6](https://github.com/matrix-org/matrix-ios-sdk/releases/tag/v0.22.6)). +- Room: Ignore the sender of a room invite without needing to join the room first ([#5807](https://github.com/vector-im/element-ios/issues/5807)) + +🐛 Bugfixes + +- Activity Indicators: Do not show user indicators when the view controller is not visible ([#5801](https://github.com/vector-im/element-ios/issues/5801)) +- Authentication: Fix social login buttons visibility during registration flow and other minor navigation tweaks. ([#5879](https://github.com/vector-im/element-ios/issues/5879)) + + ## Changes in 1.8.5 (2022-03-09) 🐛 Bugfixes diff --git a/changelog.d/5801.bugfix b/changelog.d/5801.bugfix deleted file mode 100644 index 3d58e1ee8..000000000 --- a/changelog.d/5801.bugfix +++ /dev/null @@ -1 +0,0 @@ -Activity Indicators: Do not show user indicators when the view controller is not visible diff --git a/changelog.d/5807.change b/changelog.d/5807.change deleted file mode 100644 index fa2b13524..000000000 --- a/changelog.d/5807.change +++ /dev/null @@ -1 +0,0 @@ -Room: Ignore the sender of a room invite without needing to join the room first diff --git a/changelog.d/5879.bugfix b/changelog.d/5879.bugfix deleted file mode 100644 index 68a575622..000000000 --- a/changelog.d/5879.bugfix +++ /dev/null @@ -1 +0,0 @@ -Authentication: Fix social login buttons visibility during registration flow and other minor navigation tweaks. \ No newline at end of file diff --git a/changelog.d/x-nolink-0.change b/changelog.d/x-nolink-0.change deleted file mode 100644 index f11ebf15e..000000000 --- a/changelog.d/x-nolink-0.change +++ /dev/null @@ -1 +0,0 @@ -Upgrade MatrixSDK version ([v0.22.6](https://github.com/matrix-org/matrix-ios-sdk/releases/tag/v0.22.6)). \ No newline at end of file