mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-30 21:26:57 +02:00
merged element 1.8.10
This commit is contained in:
@@ -115,8 +115,8 @@ NSString* const kMXKAccountDetailsLinkedEmailCellId = @"kMXKAccountDetailsLinked
|
||||
[userPictureButton.layer setCornerRadius:userPictureButton.frame.size.width / 2];
|
||||
userPictureButton.clipsToBounds = YES;
|
||||
|
||||
[saveUserInfoButton setTitle:[MatrixKitL10n accountSaveChanges] forState:UIControlStateNormal];
|
||||
[saveUserInfoButton setTitle:[MatrixKitL10n accountSaveChanges] forState:UIControlStateHighlighted];
|
||||
[saveUserInfoButton setTitle:[VectorL10n accountSaveChanges] forState:UIControlStateNormal];
|
||||
[saveUserInfoButton setTitle:[VectorL10n accountSaveChanges] forState:UIControlStateHighlighted];
|
||||
|
||||
// Force refresh
|
||||
self.mxAccount = _mxAccount;
|
||||
@@ -250,10 +250,10 @@ NSString* const kMXKAccountDetailsLinkedEmailCellId = @"kMXKAccountDetailsLinked
|
||||
{
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
|
||||
UIAlertController *alert = [UIAlertController alertControllerWithTitle:nil message:[MatrixKitL10n messageUnsavedChanges] preferredStyle:UIAlertControllerStyleAlert];
|
||||
UIAlertController *alert = [UIAlertController alertControllerWithTitle:nil message:[VectorL10n messageUnsavedChanges] preferredStyle:UIAlertControllerStyleAlert];
|
||||
|
||||
[self->alertsArray addObject:alert];
|
||||
[alert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n discard]
|
||||
[alert addAction:[UIAlertAction actionWithTitle:[VectorL10n discard]
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction * action) {
|
||||
|
||||
@@ -271,7 +271,7 @@ NSString* const kMXKAccountDetailsLinkedEmailCellId = @"kMXKAccountDetailsLinked
|
||||
|
||||
}]];
|
||||
|
||||
[alert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n save]
|
||||
[alert addAction:[UIAlertAction actionWithTitle:[VectorL10n save]
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction * action) {
|
||||
|
||||
@@ -443,7 +443,7 @@ NSString* const kMXKAccountDetailsLinkedEmailCellId = @"kMXKAccountDetailsLinked
|
||||
NSString *title = [error.userInfo valueForKey:NSLocalizedFailureReasonErrorKey];
|
||||
if (!title)
|
||||
{
|
||||
title = [MatrixKitL10n accountErrorDisplayNameChangeFailed];
|
||||
title = [VectorL10n accountErrorDisplayNameChangeFailed];
|
||||
}
|
||||
NSString *msg = [error.userInfo valueForKey:NSLocalizedDescriptionKey];
|
||||
|
||||
@@ -451,7 +451,7 @@ NSString* const kMXKAccountDetailsLinkedEmailCellId = @"kMXKAccountDetailsLinked
|
||||
|
||||
[self->alertsArray addObject:alert];
|
||||
|
||||
[alert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n abort]
|
||||
[alert addAction:[UIAlertAction actionWithTitle:[VectorL10n abort]
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction * action) {
|
||||
|
||||
@@ -464,7 +464,7 @@ NSString* const kMXKAccountDetailsLinkedEmailCellId = @"kMXKAccountDetailsLinked
|
||||
|
||||
}]];
|
||||
|
||||
[alert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n retry]
|
||||
[alert addAction:[UIAlertAction actionWithTitle:[VectorL10n retry]
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction * action) {
|
||||
|
||||
@@ -552,14 +552,14 @@ NSString* const kMXKAccountDetailsLinkedEmailCellId = @"kMXKAccountDetailsLinked
|
||||
NSString *title = [error.userInfo valueForKey:NSLocalizedFailureReasonErrorKey];
|
||||
if (!title)
|
||||
{
|
||||
title = [MatrixKitL10n accountErrorPictureChangeFailed];
|
||||
title = [VectorL10n accountErrorPictureChangeFailed];
|
||||
}
|
||||
NSString *msg = [error.userInfo valueForKey:NSLocalizedDescriptionKey];
|
||||
|
||||
UIAlertController *alert = [UIAlertController alertControllerWithTitle:title message:msg preferredStyle:UIAlertControllerStyleAlert];
|
||||
|
||||
[alertsArray addObject:alert];
|
||||
[alert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n abort]
|
||||
[alert addAction:[UIAlertAction actionWithTitle:[VectorL10n abort]
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction * action) {
|
||||
|
||||
@@ -573,7 +573,7 @@ NSString* const kMXKAccountDetailsLinkedEmailCellId = @"kMXKAccountDetailsLinked
|
||||
|
||||
}]];
|
||||
|
||||
[alert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n retry]
|
||||
[alert addAction:[UIAlertAction actionWithTitle:[VectorL10n retry]
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction * action) {
|
||||
|
||||
@@ -731,10 +731,10 @@ NSString* const kMXKAccountDetailsLinkedEmailCellId = @"kMXKAccountDetailsLinked
|
||||
|
||||
- (void)showValidationEmailDialogWithMessage:(NSString*)message
|
||||
{
|
||||
UIAlertController *alert = [UIAlertController alertControllerWithTitle:[MatrixKitL10n accountEmailValidationTitle] message:message preferredStyle:UIAlertControllerStyleAlert];
|
||||
UIAlertController *alert = [UIAlertController alertControllerWithTitle:[VectorL10n accountEmailValidationTitle] message:message preferredStyle:UIAlertControllerStyleAlert];
|
||||
|
||||
[alertsArray addObject:alert];
|
||||
[alert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n abort]
|
||||
[alert addAction:[UIAlertAction actionWithTitle:[VectorL10n abort]
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction * action) {
|
||||
|
||||
@@ -744,7 +744,7 @@ NSString* const kMXKAccountDetailsLinkedEmailCellId = @"kMXKAccountDetailsLinked
|
||||
|
||||
}]];
|
||||
|
||||
[alert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n continue]
|
||||
[alert addAction:[UIAlertAction actionWithTitle:[VectorL10n continue]
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction * action) {
|
||||
|
||||
@@ -779,7 +779,7 @@ NSString* const kMXKAccountDetailsLinkedEmailCellId = @"kMXKAccountDetailsLinked
|
||||
MXError *mxError = [[MXError alloc] initWithNSError:error];
|
||||
if (mxError && [mxError.errcode isEqualToString:kMXErrCodeStringThreePIDAuthFailed])
|
||||
{
|
||||
[self showValidationEmailDialogWithMessage:[MatrixKitL10n accountEmailValidationError]];
|
||||
[self showValidationEmailDialogWithMessage:[VectorL10n accountEmailValidationError]];
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -841,10 +841,10 @@ NSString* const kMXKAccountDetailsLinkedEmailCellId = @"kMXKAccountDetailsLinked
|
||||
// Email check
|
||||
if (![MXTools isEmailAddress:emailTextField.text])
|
||||
{
|
||||
UIAlertController *alert = [UIAlertController alertControllerWithTitle:[MatrixKitL10n accountErrorEmailWrongTitle] message:[MatrixKitL10n accountErrorEmailWrongDescription] preferredStyle:UIAlertControllerStyleAlert];
|
||||
UIAlertController *alert = [UIAlertController alertControllerWithTitle:[VectorL10n accountErrorEmailWrongTitle] message:[VectorL10n accountErrorEmailWrongDescription] preferredStyle:UIAlertControllerStyleAlert];
|
||||
|
||||
[alertsArray addObject:alert];
|
||||
[alert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n ok]
|
||||
[alert addAction:[UIAlertAction actionWithTitle:[VectorL10n ok]
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction * action) {
|
||||
|
||||
@@ -870,7 +870,7 @@ NSString* const kMXKAccountDetailsLinkedEmailCellId = @"kMXKAccountDetailsLinked
|
||||
if (weakSelf)
|
||||
{
|
||||
typeof(self) self = weakSelf;
|
||||
[self showValidationEmailDialogWithMessage:[MatrixKitL10n accountEmailValidationMessage]];
|
||||
[self showValidationEmailDialogWithMessage:[VectorL10n accountEmailValidationMessage]];
|
||||
}
|
||||
|
||||
} failure:^(NSError *error) {
|
||||
@@ -985,7 +985,7 @@ NSString* const kMXKAccountDetailsLinkedEmailCellId = @"kMXKAccountDetailsLinked
|
||||
{
|
||||
UITextView *textView = [[UITextView alloc] initWithFrame:CGRectMake(0, 0, tableView.frame.size.width, MAXFLOAT)];
|
||||
textView.font = [UIFont systemFontOfSize:14];
|
||||
textView.text = [NSString stringWithFormat:@"%@\n%@\n%@", [MatrixKitL10n settingsConfigHomeServer:_mxAccount.mxCredentials.homeServer], [MatrixKitL10n settingsConfigIdentityServer:_mxAccount.identityServerURL], [MatrixKitL10n settingsConfigUserId:_mxAccount.mxCredentials.userId]];
|
||||
textView.text = [NSString stringWithFormat:@"%@\n%@\n%@", [VectorL10n settingsConfigHomeServer:_mxAccount.mxCredentials.homeServer], [VectorL10n settingsConfigIdentityServer:_mxAccount.identityServerURL], [VectorL10n settingsConfigUserId:_mxAccount.mxCredentials.userId]];
|
||||
|
||||
CGSize contentSize = [textView sizeThatFits:textView.frame.size];
|
||||
return contentSize.height + 1;
|
||||
@@ -1030,8 +1030,8 @@ NSString* const kMXKAccountDetailsLinkedEmailCellId = @"kMXKAccountDetailsLinked
|
||||
submittedEmailCell.mxkTextField.text = currentEmail;
|
||||
submittedEmailCell.mxkTextField.keyboardType = UIKeyboardTypeEmailAddress;
|
||||
submittedEmailCell.mxkButton.enabled = (currentEmail.length != 0);
|
||||
[submittedEmailCell.mxkButton setTitle:[MatrixKitL10n accountLinkEmail] forState:UIControlStateNormal];
|
||||
[submittedEmailCell.mxkButton setTitle:[MatrixKitL10n accountLinkEmail] forState:UIControlStateHighlighted];
|
||||
[submittedEmailCell.mxkButton setTitle:[VectorL10n accountLinkEmail] forState:UIControlStateNormal];
|
||||
[submittedEmailCell.mxkButton setTitle:[VectorL10n accountLinkEmail] forState:UIControlStateHighlighted];
|
||||
[submittedEmailCell.mxkButton addTarget:self action:@selector(onButtonPressed:) forControlEvents:UIControlEventTouchUpInside];
|
||||
|
||||
emailSubmitButton = submittedEmailCell.mxkButton;
|
||||
@@ -1057,13 +1057,13 @@ NSString* const kMXKAccountDetailsLinkedEmailCellId = @"kMXKAccountDetailsLinked
|
||||
|
||||
if (indexPath.row == enableInAppNotifRowIndex)
|
||||
{
|
||||
notificationsCell.mxkLabel.text = [MatrixKitL10n settingsEnableInappNotifications];
|
||||
notificationsCell.mxkLabel.text = [VectorL10n settingsEnableInappNotifications];
|
||||
notificationsCell.mxkSwitch.on = _mxAccount.enableInAppNotifications;
|
||||
inAppNotificationsSwitch = notificationsCell.mxkSwitch;
|
||||
}
|
||||
else /* enablePushNotifRowIndex */
|
||||
{
|
||||
notificationsCell.mxkLabel.text = [MatrixKitL10n settingsEnablePushNotifications];
|
||||
notificationsCell.mxkLabel.text = [VectorL10n settingsEnablePushNotifications];
|
||||
notificationsCell.mxkSwitch.on = _mxAccount.pushNotificationServiceIsActive;
|
||||
notificationsCell.mxkSwitch.enabled = YES;
|
||||
apnsNotificationsSwitch = notificationsCell.mxkSwitch;
|
||||
@@ -1081,7 +1081,7 @@ NSString* const kMXKAccountDetailsLinkedEmailCellId = @"kMXKAccountDetailsLinked
|
||||
configCell = [[MXKTableViewCellWithTextView alloc] init];
|
||||
}
|
||||
|
||||
configCell.mxkTextView.text = [NSString stringWithFormat:@"%@\n%@\n%@", [MatrixKitL10n settingsConfigHomeServer:_mxAccount.mxCredentials.homeServer], [MatrixKitL10n settingsConfigIdentityServer:_mxAccount.identityServerURL], [MatrixKitL10n settingsConfigUserId:_mxAccount.mxCredentials.userId]];
|
||||
configCell.mxkTextView.text = [NSString stringWithFormat:@"%@\n%@\n%@", [VectorL10n settingsConfigHomeServer:_mxAccount.mxCredentials.homeServer], [VectorL10n settingsConfigIdentityServer:_mxAccount.identityServerURL], [VectorL10n settingsConfigUserId:_mxAccount.mxCredentials.userId]];
|
||||
|
||||
cell = configCell;
|
||||
}
|
||||
@@ -1092,8 +1092,8 @@ NSString* const kMXKAccountDetailsLinkedEmailCellId = @"kMXKAccountDetailsLinked
|
||||
{
|
||||
logoutBtnCell = [[MXKTableViewCellWithButton alloc] init];
|
||||
}
|
||||
[logoutBtnCell.mxkButton setTitle:[MatrixKitL10n actionLogout] forState:UIControlStateNormal];
|
||||
[logoutBtnCell.mxkButton setTitle:[MatrixKitL10n actionLogout] forState:UIControlStateHighlighted];
|
||||
[logoutBtnCell.mxkButton setTitle:[VectorL10n actionLogout] forState:UIControlStateNormal];
|
||||
[logoutBtnCell.mxkButton setTitle:[VectorL10n actionLogout] forState:UIControlStateHighlighted];
|
||||
[logoutBtnCell.mxkButton addTarget:self action:@selector(onButtonPressed:) forControlEvents:UIControlEventTouchUpInside];
|
||||
|
||||
logoutButton = logoutBtnCell.mxkButton;
|
||||
@@ -1133,15 +1133,15 @@ NSString* const kMXKAccountDetailsLinkedEmailCellId = @"kMXKAccountDetailsLinked
|
||||
|
||||
if (section == linkedEmailsSection)
|
||||
{
|
||||
sectionLabel.text = [MatrixKitL10n accountLinkedEmails];
|
||||
sectionLabel.text = [VectorL10n accountLinkedEmails];
|
||||
}
|
||||
else if (section == notificationsSection)
|
||||
{
|
||||
sectionLabel.text = [MatrixKitL10n settingsTitleNotifications];
|
||||
sectionLabel.text = [VectorL10n settingsTitleNotifications];
|
||||
}
|
||||
else if (section == configurationSection)
|
||||
{
|
||||
sectionLabel.text = [MatrixKitL10n settingsTitleConfig];
|
||||
sectionLabel.text = [VectorL10n settingsTitleConfig];
|
||||
}
|
||||
|
||||
return sectionHeader;
|
||||
|
||||
@@ -21,6 +21,9 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface MXKActivityHandlingViewController : UIViewController<MXKViewControllerActivityHandling>
|
||||
|
||||
/// A subclass can override this method to block `stopActivityIndicator` if there are still activities in progress
|
||||
- (BOOL)canStopActivityIndicator;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@@ -29,6 +29,11 @@
|
||||
{
|
||||
[super viewDidLoad];
|
||||
|
||||
if ([self providesCustomActivityIndicator]) {
|
||||
// If a subclass provides custom activity indicator, the default one will not even be initialized.
|
||||
return;
|
||||
}
|
||||
|
||||
// Add default activity indicator
|
||||
activityIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
|
||||
activityIndicator.backgroundColor = [UIColor colorWithRed:0.8 green:0.8 blue:0.8 alpha:1.0];
|
||||
@@ -56,9 +61,13 @@
|
||||
|
||||
#pragma mark - Activity indicator
|
||||
|
||||
- (BOOL)providesCustomActivityIndicator {
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (void)startActivityIndicator
|
||||
{
|
||||
if (activityIndicator)
|
||||
if (activityIndicator && ![self providesCustomActivityIndicator])
|
||||
{
|
||||
[self.view bringSubviewToFront:activityIndicator];
|
||||
[activityIndicator startAnimating];
|
||||
@@ -74,10 +83,15 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (void)stopActivityIndicator
|
||||
{
|
||||
[activityIndicator stopAnimating];
|
||||
- (BOOL)canStopActivityIndicator {
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void)stopActivityIndicator
|
||||
{
|
||||
if ([self canStopActivityIndicator]) {
|
||||
[activityIndicator stopAnimating];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -175,7 +175,11 @@
|
||||
_attachmentsCollection.hidden = YES;
|
||||
|
||||
// Display collection cell in full screen
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated"
|
||||
self.automaticallyAdjustsScrollViewInsets = NO;
|
||||
#pragma clang diagnostic pop
|
||||
}
|
||||
|
||||
- (BOOL)prefersStatusBarHidden
|
||||
@@ -1184,7 +1188,7 @@
|
||||
|
||||
if ([MXKAppSettings standardAppSettings].messageDetailsAllowSaving)
|
||||
{
|
||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n save]
|
||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n save]
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction * action) {
|
||||
|
||||
@@ -1213,7 +1217,7 @@
|
||||
|
||||
if ([MXKAppSettings standardAppSettings].messageDetailsAllowCopyingMedia)
|
||||
{
|
||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n copyButtonName]
|
||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n copyButtonName]
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction * action) {
|
||||
|
||||
@@ -1242,7 +1246,7 @@
|
||||
|
||||
if ([MXKAppSettings standardAppSettings].messageDetailsAllowSharing)
|
||||
{
|
||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n share]
|
||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n share]
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction * action) {
|
||||
|
||||
@@ -1285,7 +1289,7 @@
|
||||
|
||||
if ([MXMediaManager existingDownloaderWithIdentifier:attachment.downloadId])
|
||||
{
|
||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n cancelDownload]
|
||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n cancelDownload]
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction * action) {
|
||||
|
||||
@@ -1304,7 +1308,7 @@
|
||||
|
||||
if (currentAlert.actions.count)
|
||||
{
|
||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n cancel]
|
||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n cancel]
|
||||
style:UIAlertActionStyleCancel
|
||||
handler:^(UIAlertAction * action) {
|
||||
|
||||
|
||||
@@ -90,6 +90,10 @@
|
||||
*/
|
||||
@property (nonatomic) MXIdentityService *identityService;
|
||||
|
||||
@property (nonatomic) AnalyticsScreenTracker *screenTracker;
|
||||
|
||||
@property (nonatomic) BOOL isViewVisible;
|
||||
|
||||
@end
|
||||
|
||||
@implementation MXKAuthenticationViewController
|
||||
@@ -166,14 +170,14 @@
|
||||
[self updateRESTClient];
|
||||
|
||||
// Localize labels
|
||||
_homeServerLabel.text = [MatrixKitL10n loginHomeServerTitle];
|
||||
_homeServerTextField.placeholder = [MatrixKitL10n loginServerUrlPlaceholder];
|
||||
_homeServerInfoLabel.text = [MatrixKitL10n loginHomeServerInfo];
|
||||
_identityServerLabel.text = [MatrixKitL10n loginIdentityServerTitle];
|
||||
_identityServerTextField.placeholder = [MatrixKitL10n loginServerUrlPlaceholder];
|
||||
_identityServerInfoLabel.text = [MatrixKitL10n loginIdentityServerInfo];
|
||||
[_cancelAuthFallbackButton setTitle:[MatrixKitL10n cancel] forState:UIControlStateNormal];
|
||||
[_cancelAuthFallbackButton setTitle:[MatrixKitL10n cancel] forState:UIControlStateHighlighted];
|
||||
_homeServerLabel.text = [VectorL10n loginHomeServerTitle];
|
||||
_homeServerTextField.placeholder = [VectorL10n loginServerUrlPlaceholder];
|
||||
_homeServerInfoLabel.text = [VectorL10n loginHomeServerInfo];
|
||||
_identityServerLabel.text = [VectorL10n loginIdentityServerTitle];
|
||||
_identityServerTextField.placeholder = [VectorL10n loginServerUrlPlaceholder];
|
||||
_identityServerInfoLabel.text = [VectorL10n loginIdentityServerInfo];
|
||||
[_cancelAuthFallbackButton setTitle:[VectorL10n cancel] forState:UIControlStateNormal];
|
||||
[_cancelAuthFallbackButton setTitle:[VectorL10n cancel] forState:UIControlStateHighlighted];
|
||||
}
|
||||
|
||||
- (void)didReceiveMemoryWarning
|
||||
@@ -187,6 +191,9 @@
|
||||
[super viewWillAppear:animated];
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onTextFieldChange:) name:UITextFieldTextDidChangeNotification object:nil];
|
||||
|
||||
self.isViewVisible = YES;
|
||||
[self.screenTracker trackScreen];
|
||||
}
|
||||
|
||||
- (void)viewWillDisappear:(BOOL)animated
|
||||
@@ -206,6 +213,13 @@
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self name:UITextFieldTextDidChangeNotification object:nil];
|
||||
}
|
||||
|
||||
- (void)viewDidDisappear:(BOOL)animated
|
||||
{
|
||||
[super viewDidDisappear:animated];
|
||||
|
||||
self.isViewVisible = NO;
|
||||
}
|
||||
|
||||
#pragma mark - Override MXKViewController
|
||||
|
||||
- (void)onKeyboardShowAnimationComplete
|
||||
@@ -215,6 +229,8 @@
|
||||
// and report the inputAccessoryView.superview of the firstResponder in self.keyboardView.
|
||||
}
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated"
|
||||
- (void)setKeyboardHeight:(CGFloat)keyboardHeight
|
||||
{
|
||||
// Deduce the bottom inset for the scroll view (Don't forget the potential tabBar)
|
||||
@@ -229,6 +245,7 @@
|
||||
insets.bottom = scrollViewInsetBottom;
|
||||
self.authenticationScrollView.contentInset = insets;
|
||||
}
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
- (void)destroy
|
||||
{
|
||||
@@ -302,25 +319,29 @@
|
||||
if (authType == MXKAuthenticationTypeLogin)
|
||||
{
|
||||
_subTitleLabel.hidden = YES;
|
||||
[_submitButton setTitle:[MatrixKitL10n login] forState:UIControlStateNormal];
|
||||
[_submitButton setTitle:[MatrixKitL10n login] forState:UIControlStateHighlighted];
|
||||
[_authSwitchButton setTitle:[MatrixKitL10n createAccount] forState:UIControlStateNormal];
|
||||
[_authSwitchButton setTitle:[MatrixKitL10n createAccount] forState:UIControlStateHighlighted];
|
||||
[_submitButton setTitle:[VectorL10n login] forState:UIControlStateNormal];
|
||||
[_submitButton setTitle:[VectorL10n login] forState:UIControlStateHighlighted];
|
||||
[_authSwitchButton setTitle:[VectorL10n createAccount] forState:UIControlStateNormal];
|
||||
[_authSwitchButton setTitle:[VectorL10n createAccount] forState:UIControlStateHighlighted];
|
||||
|
||||
// Update supported authentication flow and associated information (defined in authentication session)
|
||||
[self refreshAuthenticationSession];
|
||||
|
||||
self.screenTracker = [[AnalyticsScreenTracker alloc] initWithScreen:AnalyticsScreenLogin];
|
||||
}
|
||||
else if (authType == MXKAuthenticationTypeRegister)
|
||||
{
|
||||
_subTitleLabel.hidden = NO;
|
||||
_subTitleLabel.text = [MatrixKitL10n loginCreateAccount];
|
||||
[_submitButton setTitle:[MatrixKitL10n signUp] forState:UIControlStateNormal];
|
||||
[_submitButton setTitle:[MatrixKitL10n signUp] forState:UIControlStateHighlighted];
|
||||
[_authSwitchButton setTitle:[MatrixKitL10n back] forState:UIControlStateNormal];
|
||||
[_authSwitchButton setTitle:[MatrixKitL10n back] forState:UIControlStateHighlighted];
|
||||
_subTitleLabel.text = [VectorL10n loginCreateAccount];
|
||||
[_submitButton setTitle:[VectorL10n signUp] forState:UIControlStateNormal];
|
||||
[_submitButton setTitle:[VectorL10n signUp] forState:UIControlStateHighlighted];
|
||||
[_authSwitchButton setTitle:[VectorL10n back] forState:UIControlStateNormal];
|
||||
[_authSwitchButton setTitle:[VectorL10n back] forState:UIControlStateHighlighted];
|
||||
|
||||
// Update supported authentication flow and associated information (defined in authentication session)
|
||||
[self refreshAuthenticationSession];
|
||||
|
||||
self.screenTracker = [[AnalyticsScreenTracker alloc] initWithScreen:AnalyticsScreenRegister];
|
||||
}
|
||||
else if (authType == MXKAuthenticationTypeForgotPassword)
|
||||
{
|
||||
@@ -328,21 +349,28 @@
|
||||
|
||||
if (isPasswordReseted)
|
||||
{
|
||||
[_submitButton setTitle:[MatrixKitL10n back] forState:UIControlStateNormal];
|
||||
[_submitButton setTitle:[MatrixKitL10n back] forState:UIControlStateHighlighted];
|
||||
[_submitButton setTitle:[VectorL10n back] forState:UIControlStateNormal];
|
||||
[_submitButton setTitle:[VectorL10n back] forState:UIControlStateHighlighted];
|
||||
}
|
||||
else
|
||||
{
|
||||
[_submitButton setTitle:[MatrixKitL10n submit] forState:UIControlStateNormal];
|
||||
[_submitButton setTitle:[MatrixKitL10n submit] forState:UIControlStateHighlighted];
|
||||
[_submitButton setTitle:[VectorL10n submit] forState:UIControlStateNormal];
|
||||
[_submitButton setTitle:[VectorL10n submit] forState:UIControlStateHighlighted];
|
||||
|
||||
[self refreshForgotPasswordSession];
|
||||
}
|
||||
|
||||
[_authSwitchButton setTitle:[MatrixKitL10n back] forState:UIControlStateNormal];
|
||||
[_authSwitchButton setTitle:[MatrixKitL10n back] forState:UIControlStateHighlighted];
|
||||
[_authSwitchButton setTitle:[VectorL10n back] forState:UIControlStateNormal];
|
||||
[_authSwitchButton setTitle:[VectorL10n back] forState:UIControlStateHighlighted];
|
||||
|
||||
self.screenTracker = [[AnalyticsScreenTracker alloc] initWithScreen:AnalyticsScreenForgotPassword];
|
||||
}
|
||||
|
||||
if (self.isViewVisible)
|
||||
{
|
||||
[self.screenTracker trackScreen];
|
||||
}
|
||||
|
||||
[self checkIdentityServer];
|
||||
}
|
||||
|
||||
@@ -758,7 +786,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
[self onFailureDuringAuthRequest:[NSError errorWithDomain:MXKAuthErrorDomain code:0 userInfo:@{NSLocalizedDescriptionKey:[MatrixKitL10n notSupportedYet]}]];
|
||||
[self onFailureDuringAuthRequest:[NSError errorWithDomain:MXKAuthErrorDomain code:0 userInfo:@{NSLocalizedDescriptionKey:[VectorL10n notSupportedYet]}]];
|
||||
|
||||
_externalRegistrationParameters = nil;
|
||||
|
||||
@@ -783,23 +811,23 @@
|
||||
// Notify user that no flow is supported
|
||||
if (_authType == MXKAuthenticationTypeLogin)
|
||||
{
|
||||
_noFlowLabel.text = [MatrixKitL10n loginErrorDoNotSupportLoginFlows];
|
||||
_noFlowLabel.text = [VectorL10n loginErrorDoNotSupportLoginFlows];
|
||||
}
|
||||
else
|
||||
{
|
||||
_noFlowLabel.text = [MatrixKitL10n loginErrorRegistrationIsNotSupported];
|
||||
_noFlowLabel.text = [VectorL10n loginErrorRegistrationIsNotSupported];
|
||||
}
|
||||
MXLogDebug(@"[MXKAuthenticationVC] Warning: %@", _noFlowLabel.text);
|
||||
|
||||
if (authenticationFallback.length)
|
||||
{
|
||||
[_retryButton setTitle:[MatrixKitL10n loginUseFallback] forState:UIControlStateNormal];
|
||||
[_retryButton setTitle:[MatrixKitL10n loginUseFallback] forState:UIControlStateNormal];
|
||||
[_retryButton setTitle:[VectorL10n loginUseFallback] forState:UIControlStateNormal];
|
||||
[_retryButton setTitle:[VectorL10n loginUseFallback] forState:UIControlStateNormal];
|
||||
}
|
||||
else
|
||||
{
|
||||
[_retryButton setTitle:[MatrixKitL10n retry] forState:UIControlStateNormal];
|
||||
[_retryButton setTitle:[MatrixKitL10n retry] forState:UIControlStateNormal];
|
||||
[_retryButton setTitle:[VectorL10n retry] forState:UIControlStateNormal];
|
||||
[_retryButton setTitle:[VectorL10n retry] forState:UIControlStateNormal];
|
||||
}
|
||||
|
||||
_noFlowLabel.hidden = NO;
|
||||
@@ -988,7 +1016,10 @@
|
||||
{
|
||||
// Trigger here a register request in order to associate the filled userId and password to the current session id
|
||||
// This will check the availability of the userId at the same time
|
||||
NSDictionary *parameters = @{@"auth": @{},
|
||||
NSDictionary *parameters = @{@"auth": @{
|
||||
@"session": self.authInputsView.authSession.session,
|
||||
@"type": kMXLoginFlowTypeDummy
|
||||
},
|
||||
@"username": self.authInputsView.userId,
|
||||
@"password": self.authInputsView.password,
|
||||
@"bind_email": @(NO),
|
||||
@@ -1007,7 +1038,7 @@
|
||||
// Sanity check
|
||||
if (!credentials.userId || !credentials.accessToken)
|
||||
{
|
||||
[self onFailureDuringAuthRequest:[NSError errorWithDomain:MXKAuthErrorDomain code:0 userInfo:@{NSLocalizedDescriptionKey:[MatrixKitL10n notSupportedYet]}]];
|
||||
[self onFailureDuringAuthRequest:[NSError errorWithDomain:MXKAuthErrorDomain code:0 userInfo:@{NSLocalizedDescriptionKey:[VectorL10n notSupportedYet]}]];
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1068,7 +1099,7 @@
|
||||
if (isUserNameInUse)
|
||||
{
|
||||
MXLogDebug(@"[MXKAuthenticationVC] User name is already use");
|
||||
[self onFailureDuringAuthRequest:[NSError errorWithDomain:MXKAuthErrorDomain code:0 userInfo:@{NSLocalizedDescriptionKey:[MatrixKitL10n authUsernameInUse]}]];
|
||||
[self onFailureDuringAuthRequest:[NSError errorWithDomain:MXKAuthErrorDomain code:0 userInfo:@{NSLocalizedDescriptionKey:[VectorL10n authUsernameInUse]}]];
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1115,7 +1146,7 @@
|
||||
else
|
||||
{
|
||||
MXLogDebug(@"[MXKAuthenticationVC] User name is missing");
|
||||
[self onFailureDuringAuthRequest:[NSError errorWithDomain:MXKAuthErrorDomain code:0 userInfo:@{NSLocalizedDescriptionKey:[MatrixKitL10n authInvalidUserName]}]];
|
||||
[self onFailureDuringAuthRequest:[NSError errorWithDomain:MXKAuthErrorDomain code:0 userInfo:@{NSLocalizedDescriptionKey:[VectorL10n authInvalidUserName]}]];
|
||||
}
|
||||
}
|
||||
else if (_authType == MXKAuthenticationTypeForgotPassword)
|
||||
@@ -1230,15 +1261,15 @@
|
||||
{
|
||||
if (self.authType == MXKAuthenticationTypeLogin)
|
||||
{
|
||||
title = [MatrixKitL10n loginErrorTitle];
|
||||
title = [VectorL10n loginErrorTitle];
|
||||
}
|
||||
else if (self.authType == MXKAuthenticationTypeRegister)
|
||||
{
|
||||
title = [MatrixKitL10n registerErrorTitle];
|
||||
title = [VectorL10n registerErrorTitle];
|
||||
}
|
||||
else
|
||||
{
|
||||
title = [MatrixKitL10n error];
|
||||
title = [VectorL10n error];
|
||||
}
|
||||
}
|
||||
NSString* message = error.localizedDescription;
|
||||
@@ -1259,31 +1290,31 @@
|
||||
{
|
||||
if ([errCode isEqualToString:kMXErrCodeStringForbidden])
|
||||
{
|
||||
message = [MatrixKitL10n loginErrorForbidden];
|
||||
message = [VectorL10n loginErrorForbidden];
|
||||
}
|
||||
else if ([errCode isEqualToString:kMXErrCodeStringUnknownToken])
|
||||
{
|
||||
message = [MatrixKitL10n loginErrorUnknownToken];
|
||||
message = [VectorL10n loginErrorUnknownToken];
|
||||
}
|
||||
else if ([errCode isEqualToString:kMXErrCodeStringBadJSON])
|
||||
{
|
||||
message = [MatrixKitL10n loginErrorBadJson];
|
||||
message = [VectorL10n loginErrorBadJson];
|
||||
}
|
||||
else if ([errCode isEqualToString:kMXErrCodeStringNotJSON])
|
||||
{
|
||||
message = [MatrixKitL10n loginErrorNotJson];
|
||||
message = [VectorL10n loginErrorNotJson];
|
||||
}
|
||||
else if ([errCode isEqualToString:kMXErrCodeStringLimitExceeded])
|
||||
{
|
||||
message = [MatrixKitL10n loginErrorLimitExceeded];
|
||||
message = [VectorL10n loginErrorLimitExceeded];
|
||||
}
|
||||
else if ([errCode isEqualToString:kMXErrCodeStringUserInUse])
|
||||
{
|
||||
message = [MatrixKitL10n loginErrorUserInUse];
|
||||
message = [VectorL10n loginErrorUserInUse];
|
||||
}
|
||||
else if ([errCode isEqualToString:kMXErrCodeStringLoginEmailURLNotYet])
|
||||
{
|
||||
message = [MatrixKitL10n loginErrorLoginEmailNotYet];
|
||||
message = [VectorL10n loginErrorLoginEmailNotYet];
|
||||
}
|
||||
else if ([errCode isEqualToString:kMXErrCodeStringResourceLimitExceeded])
|
||||
{
|
||||
@@ -1305,7 +1336,7 @@
|
||||
|
||||
alert = [UIAlertController alertControllerWithTitle:title message:message preferredStyle:UIAlertControllerStyleAlert];
|
||||
|
||||
[alert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n ok]
|
||||
[alert addAction:[UIAlertAction actionWithTitle:[VectorL10n ok]
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction * action) {
|
||||
|
||||
@@ -1348,20 +1379,20 @@
|
||||
adminContact = [NSURL URLWithString:adminContactString];
|
||||
}
|
||||
|
||||
NSString *title = [MatrixKitL10n loginErrorResourceLimitExceededTitle];
|
||||
NSString *title = [VectorL10n loginErrorResourceLimitExceededTitle];
|
||||
|
||||
// Build the message content
|
||||
NSMutableString *message = [NSMutableString new];
|
||||
if ([limitType isEqualToString:kMXErrorResourceLimitExceededLimitTypeMonthlyActiveUserValue])
|
||||
{
|
||||
[message appendString:[MatrixKitL10n loginErrorResourceLimitExceededMessageMonthlyActiveUser]];
|
||||
[message appendString:[VectorL10n loginErrorResourceLimitExceededMessageMonthlyActiveUser]];
|
||||
}
|
||||
else
|
||||
{
|
||||
[message appendString:[MatrixKitL10n loginErrorResourceLimitExceededMessageDefault]];
|
||||
[message appendString:[VectorL10n loginErrorResourceLimitExceededMessageDefault]];
|
||||
}
|
||||
|
||||
[message appendString:[MatrixKitL10n loginErrorResourceLimitExceededMessageContact]];
|
||||
[message appendString:[VectorL10n loginErrorResourceLimitExceededMessageContact]];
|
||||
|
||||
// Build the alert
|
||||
alert = [UIAlertController alertControllerWithTitle:title message:message preferredStyle:UIAlertControllerStyleAlert];
|
||||
@@ -1369,7 +1400,7 @@
|
||||
MXWeakify(self);
|
||||
if (adminContact && onAdminContactTapped)
|
||||
{
|
||||
[alert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n loginErrorResourceLimitExceededContactButton]
|
||||
[alert addAction:[UIAlertAction actionWithTitle:[VectorL10n loginErrorResourceLimitExceededContactButton]
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction * action)
|
||||
{
|
||||
@@ -1382,7 +1413,7 @@
|
||||
}]];
|
||||
}
|
||||
|
||||
[alert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n cancel]
|
||||
[alert addAction:[UIAlertAction actionWithTitle:[VectorL10n cancel]
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction * action)
|
||||
{
|
||||
@@ -1424,9 +1455,9 @@
|
||||
[alert dismissViewControllerAnimated:NO completion:nil];
|
||||
}
|
||||
|
||||
alert = [UIAlertController alertControllerWithTitle:[MatrixKitL10n loginErrorAlreadyLoggedIn] message:nil preferredStyle:UIAlertControllerStyleAlert];
|
||||
alert = [UIAlertController alertControllerWithTitle:[VectorL10n loginErrorAlreadyLoggedIn] message:nil preferredStyle:UIAlertControllerStyleAlert];
|
||||
|
||||
[alert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n ok]
|
||||
[alert addAction:[UIAlertAction actionWithTitle:[VectorL10n ok]
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction * action) {
|
||||
|
||||
@@ -1545,9 +1576,9 @@
|
||||
}
|
||||
|
||||
#if TARGET_OS_IPHONE
|
||||
NSString *deviceName = [[UIDevice currentDevice].model isEqualToString:@"iPad"] ? [MatrixKitL10n loginTabletDevice] : [MatrixKitL10n loginMobileDevice];
|
||||
NSString *deviceName = [[UIDevice currentDevice].model isEqualToString:@"iPad"] ? [VectorL10n loginTabletDevice] : [VectorL10n loginMobileDevice];
|
||||
#elif TARGET_OS_OSX
|
||||
NSString *deviceName = [MatrixKitL10n loginDesktopDevice];
|
||||
NSString *deviceName = [VectorL10n loginDesktopDevice];
|
||||
#endif
|
||||
|
||||
return deviceName;
|
||||
@@ -1592,7 +1623,7 @@
|
||||
// Remove the potential auth inputs view
|
||||
self.authInputsView = nil;
|
||||
|
||||
_noFlowLabel.text = [MatrixKitL10n loginErrorForgotPasswordIsNotSupported];
|
||||
_noFlowLabel.text = [VectorL10n loginErrorForgotPasswordIsNotSupported];
|
||||
|
||||
MXLogDebug(@"[MXKAuthenticationVC] Warning: %@", _noFlowLabel.text);
|
||||
|
||||
@@ -1621,12 +1652,12 @@
|
||||
__block BOOL isTrusted;
|
||||
dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
|
||||
|
||||
NSString *title = [MatrixKitL10n sslCouldNotVerify];
|
||||
NSString *homeserverURLStr = [MatrixKitL10n sslHomeserverUrl:homeserverURL];
|
||||
NSString *fingerprint = [MatrixKitL10n sslFingerprintHash:@"SHA256"];
|
||||
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%@", [MatrixKitL10n sslCertNotTrust], [MatrixKitL10n sslCertNewAccountExpl], homeserverURLStr, fingerprint, certFingerprint, [MatrixKitL10n sslOnlyAccept]];
|
||||
NSString *msg = [NSString stringWithFormat:@"%@\n\n%@\n\n%@\n\n%@\n\n%@\n\n%@", [VectorL10n sslCertNotTrust], [VectorL10n sslCertNewAccountExpl], homeserverURLStr, fingerprint, certFingerprint, [VectorL10n sslOnlyAccept]];
|
||||
|
||||
if (self->alert)
|
||||
{
|
||||
@@ -1635,7 +1666,7 @@
|
||||
|
||||
self->alert = [UIAlertController alertControllerWithTitle:title message:msg preferredStyle:UIAlertControllerStyleAlert];
|
||||
|
||||
[self->alert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n cancel]
|
||||
[self->alert addAction:[UIAlertAction actionWithTitle:[VectorL10n cancel]
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction * action) {
|
||||
|
||||
@@ -1645,7 +1676,7 @@
|
||||
|
||||
}]];
|
||||
|
||||
[self->alert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n sslTrust]
|
||||
[self->alert addAction:[UIAlertAction actionWithTitle:[VectorL10n sslTrust]
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction * action) {
|
||||
|
||||
@@ -1704,7 +1735,7 @@
|
||||
// Sanity check
|
||||
if (!credentials.userId || !credentials.accessToken)
|
||||
{
|
||||
[self onFailureDuringAuthRequest:[NSError errorWithDomain:MXKAuthErrorDomain code:0 userInfo:@{NSLocalizedDescriptionKey:[MatrixKitL10n notSupportedYet]}]];
|
||||
[self onFailureDuringAuthRequest:[NSError errorWithDomain:MXKAuthErrorDomain code:0 userInfo:@{NSLocalizedDescriptionKey:[VectorL10n notSupportedYet]}]];
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1746,7 +1777,7 @@
|
||||
// Sanity check
|
||||
if (!credentials.userId || !credentials.accessToken)
|
||||
{
|
||||
[self onFailureDuringAuthRequest:[NSError errorWithDomain:MXKAuthErrorDomain code:0 userInfo:@{NSLocalizedDescriptionKey:[MatrixKitL10n notSupportedYet]}]];
|
||||
[self onFailureDuringAuthRequest:[NSError errorWithDomain:MXKAuthErrorDomain code:0 userInfo:@{NSLocalizedDescriptionKey:[VectorL10n notSupportedYet]}]];
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1812,7 +1843,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
[self onFailureDuringAuthRequest:[NSError errorWithDomain:MXKAuthErrorDomain code:0 userInfo:@{NSLocalizedDescriptionKey:[MatrixKitL10n notSupportedYet]}]];
|
||||
[self onFailureDuringAuthRequest:[NSError errorWithDomain:MXKAuthErrorDomain code:0 userInfo:@{NSLocalizedDescriptionKey:[VectorL10n notSupportedYet]}]];
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1863,9 +1894,9 @@
|
||||
[self->alert dismissViewControllerAnimated:NO completion:nil];
|
||||
}
|
||||
|
||||
self->alert = [UIAlertController alertControllerWithTitle:[MatrixKitL10n error] message:[MatrixKitL10n authResetPasswordErrorUnauthorized] preferredStyle:UIAlertControllerStyleAlert];
|
||||
self->alert = [UIAlertController alertControllerWithTitle:[VectorL10n error] message:[VectorL10n authResetPasswordErrorUnauthorized] preferredStyle:UIAlertControllerStyleAlert];
|
||||
|
||||
[self->alert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n ok]
|
||||
[self->alert addAction:[UIAlertAction actionWithTitle:[VectorL10n ok]
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction * action) {
|
||||
|
||||
@@ -1889,7 +1920,7 @@
|
||||
{
|
||||
userInfo = [NSMutableDictionary dictionary];
|
||||
}
|
||||
userInfo[NSLocalizedDescriptionKey] = [MatrixKitL10n authResetPasswordErrorNotFound];
|
||||
userInfo[NSLocalizedDescriptionKey] = [VectorL10n authResetPasswordErrorNotFound];
|
||||
|
||||
[self onFailureDuringAuthRequest:[NSError errorWithDomain:kMXNSErrorDomain code:0 userInfo:userInfo]];
|
||||
}
|
||||
@@ -1923,7 +1954,7 @@
|
||||
NSString *title = [error.userInfo valueForKey:NSLocalizedFailureReasonErrorKey];
|
||||
if (!title)
|
||||
{
|
||||
title = [MatrixKitL10n error];
|
||||
title = [VectorL10n error];
|
||||
}
|
||||
NSString *msg = [error.userInfo valueForKey:NSLocalizedDescriptionKey];
|
||||
|
||||
@@ -1934,7 +1965,7 @@
|
||||
|
||||
alert = [UIAlertController alertControllerWithTitle:title message:msg preferredStyle:UIAlertControllerStyleAlert];
|
||||
|
||||
[alert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n dismiss]
|
||||
[alert addAction:[UIAlertAction actionWithTitle:[VectorL10n dismiss]
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction * action) {
|
||||
|
||||
@@ -1980,10 +2011,10 @@
|
||||
_noFlowLabel.text = [error.userInfo valueForKey:NSLocalizedDescriptionKey];
|
||||
if (!_noFlowLabel.text.length)
|
||||
{
|
||||
_noFlowLabel.text = [MatrixKitL10n loginErrorNoLoginFlow];
|
||||
_noFlowLabel.text = [VectorL10n loginErrorNoLoginFlow];
|
||||
}
|
||||
[_retryButton setTitle:[MatrixKitL10n retry] forState:UIControlStateNormal];
|
||||
[_retryButton setTitle:[MatrixKitL10n retry] forState:UIControlStateNormal];
|
||||
[_retryButton setTitle:[VectorL10n retry] forState:UIControlStateNormal];
|
||||
[_retryButton setTitle:[VectorL10n retry] forState:UIControlStateNormal];
|
||||
_retryButton.hidden = NO;
|
||||
}
|
||||
}
|
||||
@@ -2001,7 +2032,7 @@
|
||||
}
|
||||
else if (status == AFNetworkReachabilityStatusNotReachable)
|
||||
{
|
||||
_noFlowLabel.text = [MatrixKitL10n networkErrorNotReachable];
|
||||
_noFlowLabel.text = [VectorL10n networkErrorNotReachable];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2114,7 +2145,7 @@
|
||||
{
|
||||
if (!cancelFallbackBarButton)
|
||||
{
|
||||
cancelFallbackBarButton = [[UIBarButtonItem alloc] initWithTitle:[MatrixKitL10n loginLeaveFallback] style:UIBarButtonItemStylePlain target:self action:@selector(hideRegistrationFallbackView)];
|
||||
cancelFallbackBarButton = [[UIBarButtonItem alloc] initWithTitle:[VectorL10n loginLeaveFallback] style:UIBarButtonItemStylePlain target:self action:@selector(hideRegistrationFallbackView)];
|
||||
}
|
||||
|
||||
// Add cancel button in right bar items
|
||||
|
||||
@@ -151,14 +151,14 @@ static const CGFloat kLocalPreviewMargin = 20;
|
||||
[self.speakerButton setImage:[NSBundle mxk_imageFromMXKAssetsBundleWithName:@"icon_speaker_on"] forState:UIControlStateSelected];
|
||||
|
||||
// Localize string
|
||||
[answerCallButton setTitle:[MatrixKitL10n answerCall] forState:UIControlStateNormal];
|
||||
[answerCallButton setTitle:[MatrixKitL10n answerCall] forState:UIControlStateHighlighted];
|
||||
[rejectCallButton setTitle:[MatrixKitL10n rejectCall] forState:UIControlStateNormal];
|
||||
[rejectCallButton setTitle:[MatrixKitL10n rejectCall] forState:UIControlStateHighlighted];
|
||||
[endCallButton setTitle:[MatrixKitL10n endCall] forState:UIControlStateNormal];
|
||||
[endCallButton setTitle:[MatrixKitL10n endCall] forState:UIControlStateHighlighted];
|
||||
[_resumeButton setTitle:[MatrixKitL10n resumeCall] forState:UIControlStateNormal];
|
||||
[_resumeButton setTitle:[MatrixKitL10n resumeCall] forState:UIControlStateHighlighted];
|
||||
[answerCallButton setTitle:[VectorL10n answerCall] forState:UIControlStateNormal];
|
||||
[answerCallButton setTitle:[VectorL10n answerCall] forState:UIControlStateHighlighted];
|
||||
[rejectCallButton setTitle:[VectorL10n rejectCall] forState:UIControlStateNormal];
|
||||
[rejectCallButton setTitle:[VectorL10n rejectCall] forState:UIControlStateHighlighted];
|
||||
[endCallButton setTitle:[VectorL10n endCall] forState:UIControlStateNormal];
|
||||
[endCallButton setTitle:[VectorL10n endCall] forState:UIControlStateHighlighted];
|
||||
[_resumeButton setTitle:[VectorL10n resumeCall] forState:UIControlStateNormal];
|
||||
[_resumeButton setTitle:[VectorL10n resumeCall] forState:UIControlStateHighlighted];
|
||||
|
||||
// Refresh call information
|
||||
self.mxCall = mxCall;
|
||||
@@ -364,7 +364,7 @@ static const CGFloat kLocalPreviewMargin = 20;
|
||||
// Check the permission right now
|
||||
NSString *appDisplayName = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleDisplayName"];
|
||||
[MXKTools checkAccessForMediaType:AVMediaTypeVideo
|
||||
manualChangeMessage:[MatrixKitL10n cameraAccessNotGrantedForCall:appDisplayName]
|
||||
manualChangeMessage:[VectorL10n cameraAccessNotGrantedForCall:appDisplayName]
|
||||
|
||||
showPopUpInViewController:self completionHandler:^(BOOL granted) {
|
||||
|
||||
@@ -509,17 +509,17 @@ static const CGFloat kLocalPreviewMargin = 20;
|
||||
|
||||
if (mxCall.isConsulting)
|
||||
{
|
||||
callerNameLabel.text = [MatrixKitL10n callConsultingWithUser:peerDisplayName];
|
||||
callerNameLabel.text = [VectorL10n callConsultingWithUser:peerDisplayName];
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mxCall.isVideoCall)
|
||||
{
|
||||
callerNameLabel.text = [MatrixKitL10n callVideoWithUser:peerDisplayName];
|
||||
callerNameLabel.text = [VectorL10n callVideoWithUser:peerDisplayName];
|
||||
}
|
||||
else
|
||||
{
|
||||
callerNameLabel.text = [MatrixKitL10n callVoiceWithUser:peerDisplayName];
|
||||
callerNameLabel.text = [VectorL10n callVoiceWithUser:peerDisplayName];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -641,8 +641,8 @@ static const CGFloat kLocalPreviewMargin = 20;
|
||||
NSString *appDisplayName = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleDisplayName"];
|
||||
|
||||
[MXKTools checkAccessForCall:mxCall.isVideoCall
|
||||
manualChangeMessageForAudio:[MatrixKitL10n microphoneAccessNotGrantedForCall:appDisplayName]
|
||||
manualChangeMessageForVideo:[MatrixKitL10n cameraAccessNotGrantedForCall:appDisplayName]
|
||||
manualChangeMessageForAudio:[VectorL10n microphoneAccessNotGrantedForCall:appDisplayName]
|
||||
manualChangeMessageForVideo:[VectorL10n cameraAccessNotGrantedForCall:appDisplayName]
|
||||
showPopUpInViewController:self completionHandler:^(BOOL granted) {
|
||||
|
||||
if (granted)
|
||||
@@ -687,7 +687,7 @@ static const CGFloat kLocalPreviewMargin = 20;
|
||||
if (self.speakerButton == nil)
|
||||
{
|
||||
// audio device action
|
||||
UIAlertAction *audioDeviceAction = [UIAlertAction actionWithTitle:[MatrixKitL10n callMoreActionsChangeAudioDevice]
|
||||
UIAlertAction *audioDeviceAction = [UIAlertAction actionWithTitle:[VectorL10n callMoreActionsChangeAudioDevice]
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction * action) {
|
||||
|
||||
@@ -705,7 +705,7 @@ static const CGFloat kLocalPreviewMargin = 20;
|
||||
// check the call can send DTMF tones
|
||||
if (self.mxCall.supportsDTMF)
|
||||
{
|
||||
UIAlertAction *dialpadAction = [UIAlertAction actionWithTitle:[MatrixKitL10n callMoreActionsDialpad]
|
||||
UIAlertAction *dialpadAction = [UIAlertAction actionWithTitle:[VectorL10n callMoreActionsDialpad]
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction * action) {
|
||||
|
||||
@@ -721,7 +721,7 @@ static const CGFloat kLocalPreviewMargin = 20;
|
||||
// check the call be holded/unholded
|
||||
if (mxCall.supportsHolding)
|
||||
{
|
||||
NSString *actionLocKey = (mxCall.state == MXCallStateOnHold) ? [MatrixKitL10n callMoreActionsUnhold] : [MatrixKitL10n callMoreActionsHold];
|
||||
NSString *actionLocKey = (mxCall.state == MXCallStateOnHold) ? [VectorL10n callMoreActionsUnhold] : [VectorL10n callMoreActionsHold];
|
||||
|
||||
UIAlertAction *holdAction = [UIAlertAction actionWithTitle:actionLocKey
|
||||
style:UIAlertActionStyleDefault
|
||||
@@ -739,7 +739,7 @@ static const CGFloat kLocalPreviewMargin = 20;
|
||||
// check the call be transferred
|
||||
if (mxCall.supportsTransferring && self.peer)
|
||||
{
|
||||
UIAlertAction *transferAction = [UIAlertAction actionWithTitle:[MatrixKitL10n callMoreActionsTransfer]
|
||||
UIAlertAction *transferAction = [UIAlertAction actionWithTitle:[VectorL10n callMoreActionsTransfer]
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction * action) {
|
||||
|
||||
@@ -765,7 +765,7 @@ static const CGFloat kLocalPreviewMargin = 20;
|
||||
}];
|
||||
|
||||
// add cancel action always
|
||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n cancel]
|
||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n cancel]
|
||||
style:UIAlertActionStyleCancel
|
||||
handler:^(UIAlertAction * action) {
|
||||
|
||||
@@ -833,7 +833,7 @@ static const CGFloat kLocalPreviewMargin = 20;
|
||||
NSString *name = route.name;
|
||||
if (route.routeType == MXiOSAudioOutputRouteTypeLoudSpeakers)
|
||||
{
|
||||
name = [MatrixKitL10n callMoreActionsAudioUseDevice];
|
||||
name = [VectorL10n callMoreActionsAudioUseDevice];
|
||||
}
|
||||
MXWeakify(self);
|
||||
UIAlertAction *routeAction = [UIAlertAction actionWithTitle:name
|
||||
@@ -863,7 +863,7 @@ static const CGFloat kLocalPreviewMargin = 20;
|
||||
|
||||
// add cancel action
|
||||
MXWeakify(self);
|
||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n cancel]
|
||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n cancel]
|
||||
style:UIAlertActionStyleCancel
|
||||
handler:^(UIAlertAction * action) {
|
||||
|
||||
@@ -911,7 +911,7 @@ static const CGFloat kLocalPreviewMargin = 20;
|
||||
{
|
||||
case MXCallStateFledgling:
|
||||
self.isRinging = NO;
|
||||
callStatusLabel.text = [MatrixKitL10n callConnecting];
|
||||
callStatusLabel.text = [VectorL10n callConnecting];
|
||||
break;
|
||||
case MXCallStateWaitLocalMedia:
|
||||
self.isRinging = NO;
|
||||
@@ -934,12 +934,12 @@ static const CGFloat kLocalPreviewMargin = 20;
|
||||
self.isRinging = YES;
|
||||
}
|
||||
|
||||
callStatusLabel.text = [MatrixKitL10n callConnecting];
|
||||
callStatusLabel.text = [VectorL10n callConnecting];
|
||||
break;
|
||||
}
|
||||
case MXCallStateInviteSent:
|
||||
{
|
||||
callStatusLabel.text = [MatrixKitL10n callRinging];
|
||||
callStatusLabel.text = [VectorL10n callRinging];
|
||||
break;
|
||||
}
|
||||
case MXCallStateRinging:
|
||||
@@ -947,11 +947,11 @@ static const CGFloat kLocalPreviewMargin = 20;
|
||||
[self configureSpeakerButton];
|
||||
if (call.isVideoCall)
|
||||
{
|
||||
callStatusLabel.text = [MatrixKitL10n incomingVideoCall];
|
||||
callStatusLabel.text = [VectorL10n incomingVideoCall];
|
||||
}
|
||||
else
|
||||
{
|
||||
callStatusLabel.text = [MatrixKitL10n incomingVoiceCall];
|
||||
callStatusLabel.text = [VectorL10n incomingVoiceCall];
|
||||
}
|
||||
// Update bottom bar
|
||||
endCallButton.hidden = YES;
|
||||
@@ -1008,7 +1008,7 @@ static const CGFloat kLocalPreviewMargin = 20;
|
||||
|
||||
break;
|
||||
case MXCallStateOnHold:
|
||||
callStatusLabel.text = [MatrixKitL10n callHolded];
|
||||
callStatusLabel.text = [VectorL10n callHolded];
|
||||
|
||||
break;
|
||||
case MXCallStateRemotelyOnHold:
|
||||
@@ -1017,20 +1017,20 @@ static const CGFloat kLocalPreviewMargin = 20;
|
||||
speakerButton.enabled = NO;
|
||||
cameraSwitchButton.enabled = NO;
|
||||
self.moreButton.enabled = NO;
|
||||
callStatusLabel.text = [MatrixKitL10n callRemoteHolded:peerDisplayName];
|
||||
callStatusLabel.text = [VectorL10n callRemoteHolded:peerDisplayName];
|
||||
|
||||
break;
|
||||
case MXCallStateInviteExpired:
|
||||
// MXCallStateInviteExpired state is sent as an notification
|
||||
// MXCall will move quickly to the MXCallStateEnded state
|
||||
self.isRinging = NO;
|
||||
callStatusLabel.text = [MatrixKitL10n callInviteExpired];
|
||||
callStatusLabel.text = [VectorL10n callInviteExpired];
|
||||
|
||||
break;
|
||||
case MXCallStateEnded:
|
||||
{
|
||||
self.isRinging = NO;
|
||||
callStatusLabel.text = [MatrixKitL10n callEnded];
|
||||
callStatusLabel.text = [VectorL10n callEnded];
|
||||
|
||||
NSString *soundName = [self soundNameForCallEnding];
|
||||
if (soundName)
|
||||
@@ -1068,18 +1068,18 @@ static const CGFloat kLocalPreviewMargin = 20;
|
||||
NSString *title = [error.userInfo valueForKey:NSLocalizedFailureReasonErrorKey];
|
||||
if (!title)
|
||||
{
|
||||
title = [MatrixKitL10n error];
|
||||
title = [VectorL10n error];
|
||||
}
|
||||
NSString *msg = [error.userInfo valueForKey:NSLocalizedDescriptionKey];
|
||||
if (!msg)
|
||||
{
|
||||
msg = [MatrixKitL10n errorCommonMessage];
|
||||
msg = [VectorL10n errorCommonMessage];
|
||||
}
|
||||
|
||||
MXWeakify(self);
|
||||
errorAlert = [UIAlertController alertControllerWithTitle:title message:msg preferredStyle:UIAlertControllerStyleAlert];
|
||||
|
||||
[errorAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n ok]
|
||||
[errorAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n ok]
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction * action) {
|
||||
|
||||
@@ -1102,7 +1102,7 @@ static const CGFloat kLocalPreviewMargin = 20;
|
||||
|
||||
if (call.isConsulting)
|
||||
{
|
||||
NSString *title = [MatrixKitL10n callTransferToUser:call.transferee.displayname];
|
||||
NSString *title = [VectorL10n callTransferToUser:call.transferee.displayname];
|
||||
[_transferButton setTitle:title forState:UIControlStateNormal];
|
||||
_transferButton.hidden = call.state != MXCallStateConnected;
|
||||
}
|
||||
@@ -1132,11 +1132,11 @@ static const CGFloat kLocalPreviewMargin = 20;
|
||||
|
||||
if (mxCall.isVideoCall)
|
||||
{
|
||||
callerNameLabel.text = [MatrixKitL10n callVideoWithUser:peerDisplayName];
|
||||
callerNameLabel.text = [VectorL10n callVideoWithUser:peerDisplayName];
|
||||
}
|
||||
else
|
||||
{
|
||||
callerNameLabel.text = [MatrixKitL10n callVoiceWithUser:peerDisplayName];
|
||||
callerNameLabel.text = [VectorL10n callVoiceWithUser:peerDisplayName];
|
||||
}
|
||||
|
||||
if (peerAvatarURL)
|
||||
@@ -1422,29 +1422,31 @@ static const CGFloat kLocalPreviewMargin = 20;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)updateProximityAndSleep
|
||||
{
|
||||
BOOL inCall = (mxCall.state == MXCallStateConnected || mxCall.state == MXCallStateRinging || mxCall.state == MXCallStateInviteSent || mxCall.state == MXCallStateConnecting || mxCall.state == MXCallStateCreateOffer || mxCall.state == MXCallStateCreateAnswer);
|
||||
|
||||
if (inCall)
|
||||
{
|
||||
BOOL isBuiltInReceiverUsed = self.isBuiltInReceiverAudioOuput;
|
||||
|
||||
// Enable the proximity monitoring when the built in receiver is used as the audio output.
|
||||
BOOL enableProxMonitoring = isBuiltInReceiverUsed;
|
||||
[[UIDevice currentDevice] setProximityMonitoringEnabled:enableProxMonitoring];
|
||||
|
||||
// Disable the idle timer during a video call, or during a voice call which is performed with the built-in receiver.
|
||||
// Note: if the device is locked, VoIP calling get dropped if an incoming GSM call is received.
|
||||
BOOL disableIdleTimer = mxCall.isVideoCall || isBuiltInReceiverUsed;
|
||||
|
||||
UIApplication *sharedApplication = [UIApplication performSelector:@selector(sharedApplication)];
|
||||
if (sharedApplication)
|
||||
{
|
||||
sharedApplication.idleTimerDisabled = disableIdleTimer;
|
||||
}
|
||||
}
|
||||
}
|
||||
- (void)updateProximityAndSleep
|
||||
{
|
||||
BOOL inCall = (mxCall.state == MXCallStateConnected || mxCall.state == MXCallStateRinging || mxCall.state == MXCallStateInviteSent || mxCall.state == MXCallStateConnecting || mxCall.state == MXCallStateCreateOffer || mxCall.state == MXCallStateCreateAnswer);
|
||||
|
||||
BOOL isBuiltInReceiverUsed = self.isBuiltInReceiverAudioOuput;
|
||||
|
||||
// Enable the proximity monitoring when the built in receiver is used as the audio output.
|
||||
BOOL enableProxMonitoring = inCall && isBuiltInReceiverUsed;
|
||||
|
||||
UIDevice *device = [UIDevice currentDevice];
|
||||
if (device && device.isProximityMonitoringEnabled != enableProxMonitoring)
|
||||
{
|
||||
[device setProximityMonitoringEnabled:enableProxMonitoring];
|
||||
}
|
||||
|
||||
// Disable the idle timer during a video call, or during a voice call which is performed with the built-in receiver.
|
||||
// Note: if the device is locked, VoIP calling get dropped if an incoming GSM call is received.
|
||||
BOOL disableIdleTimer = inCall && (mxCall.isVideoCall || isBuiltInReceiverUsed);
|
||||
|
||||
UIApplication *sharedApplication = [UIApplication performSelector:@selector(sharedApplication)];
|
||||
if (sharedApplication && sharedApplication.isIdleTimerDisabled != disableIdleTimer)
|
||||
{
|
||||
sharedApplication.idleTimerDisabled = disableIdleTimer;
|
||||
}
|
||||
}
|
||||
|
||||
- (UIView *)createIncomingCallView
|
||||
{
|
||||
|
||||
@@ -152,8 +152,8 @@
|
||||
cell.mxkLabel.text = @"";
|
||||
}
|
||||
|
||||
[cell.mxkButton setTitle:[MatrixKitL10n startChat] forState:UIControlStateNormal];
|
||||
[cell.mxkButton setTitle:[MatrixKitL10n startChat] forState:UIControlStateHighlighted];
|
||||
[cell.mxkButton setTitle:[VectorL10n startChat] forState:UIControlStateNormal];
|
||||
[cell.mxkButton setTitle:[VectorL10n startChat] forState:UIControlStateHighlighted];
|
||||
cell.mxkButton.tag = row;
|
||||
[cell.mxkButton addTarget:self action:@selector(startChat:) forControlEvents:UIControlEventTouchUpInside];
|
||||
|
||||
|
||||
@@ -117,8 +117,8 @@
|
||||
}
|
||||
|
||||
// Localize string
|
||||
[_contactsControls setTitle:[MatrixKitL10n contactMxUsers] forSegmentAtIndex:0];
|
||||
[_contactsControls setTitle:[MatrixKitL10n contactLocalContacts] forSegmentAtIndex:1];
|
||||
[_contactsControls setTitle:[VectorL10n contactMxUsers] forSegmentAtIndex:0];
|
||||
[_contactsControls setTitle:[VectorL10n contactLocalContacts] forSegmentAtIndex:1];
|
||||
|
||||
// Apply search option in navigation bar
|
||||
self.enableBarButtonSearch = _enableBarButtonSearch;
|
||||
|
||||
@@ -109,7 +109,7 @@ NSString* const kMXKCountryPickerViewControllerCountryCellId = @"kMXKCountryPick
|
||||
[[[self class] nib] instantiateWithOwner:self options:nil];
|
||||
}
|
||||
|
||||
self.navigationItem.title = [MatrixKitL10n countryPickerTitle];
|
||||
self.navigationItem.title = [VectorL10n countryPickerTitle];
|
||||
|
||||
[self setupSearchController];
|
||||
}
|
||||
@@ -152,7 +152,7 @@ NSString* const kMXKCountryPickerViewControllerCountryCellId = @"kMXKCountryPick
|
||||
{
|
||||
UISearchController *searchController = [[UISearchController alloc]
|
||||
initWithSearchResultsController:nil];
|
||||
searchController.dimsBackgroundDuringPresentation = NO;
|
||||
searchController.obscuresBackgroundDuringPresentation = NO;
|
||||
searchController.hidesNavigationBarDuringPresentation = NO;
|
||||
searchController.searchResultsUpdater = self;
|
||||
|
||||
|
||||
@@ -92,6 +92,8 @@
|
||||
[[[self class] nib] instantiateWithOwner:self options:nil];
|
||||
}
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated"
|
||||
// Adjust search bar Top constraint to take into account potential navBar.
|
||||
if (_groupsSearchBarTopConstraint)
|
||||
{
|
||||
@@ -123,6 +125,7 @@
|
||||
|
||||
[NSLayoutConstraint activateConstraints:@[_groupsTableViewBottomConstraint]];
|
||||
}
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
// Hide search bar by default
|
||||
[self hideSearchBar:YES];
|
||||
@@ -209,6 +212,8 @@
|
||||
self.keyboardView = _groupsSearchBar.inputAccessoryView.superview;
|
||||
}
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated"
|
||||
- (void)setKeyboardHeight:(CGFloat)keyboardHeight
|
||||
{
|
||||
// Deduce the bottom constraint for the table view (Don't forget the potential tabBar)
|
||||
@@ -225,6 +230,7 @@
|
||||
// Force layout immediately to take into account new constraint
|
||||
[self.view layoutIfNeeded];
|
||||
}
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
- (void)destroy
|
||||
{
|
||||
|
||||
@@ -84,7 +84,7 @@ NSString* const kMXKLanguagePickerCellDataKeyLanguage = @"language";
|
||||
// Populate cellDataArray
|
||||
// Start by the default language chosen by the OS
|
||||
NSString *defaultLanguage = [MXKLanguagePickerViewController defaultLanguage];
|
||||
NSString *languageDescription = [MatrixKitL10n languagePickerDefaultLanguage:[MXKLanguagePickerViewController languageDescription:defaultLanguage]];
|
||||
NSString *languageDescription = [VectorL10n languagePickerDefaultLanguage:[MXKLanguagePickerViewController languageDescription:defaultLanguage]];
|
||||
|
||||
[cellDataArray addObject:@{
|
||||
kMXKLanguagePickerCellDataKeyText:languageDescription
|
||||
@@ -143,7 +143,7 @@ NSString* const kMXKLanguagePickerCellDataKeyLanguage = @"language";
|
||||
|
||||
[self setupSearchController];
|
||||
|
||||
self.navigationItem.title = [MatrixKitL10n languagePickerTitle];
|
||||
self.navigationItem.title = [VectorL10n languagePickerTitle];
|
||||
|
||||
}
|
||||
|
||||
@@ -160,7 +160,7 @@ NSString* const kMXKLanguagePickerCellDataKeyLanguage = @"language";
|
||||
{
|
||||
UISearchController *searchController = [[UISearchController alloc]
|
||||
initWithSearchResultsController:nil];
|
||||
searchController.dimsBackgroundDuringPresentation = NO;
|
||||
searchController.obscuresBackgroundDuringPresentation = NO;
|
||||
searchController.hidesNavigationBarDuringPresentation = NO;
|
||||
searchController.searchResultsUpdater = self;
|
||||
|
||||
|
||||
@@ -317,13 +317,13 @@
|
||||
|
||||
if (areAllDisabled)
|
||||
{
|
||||
[masterBtnCell.mxkButton setTitle:[MatrixKitL10n notificationSettingsEnableNotifications] forState:UIControlStateNormal];
|
||||
[masterBtnCell.mxkButton setTitle:[MatrixKitL10n notificationSettingsEnableNotifications] forState:UIControlStateHighlighted];
|
||||
[masterBtnCell.mxkButton setTitle:[VectorL10n notificationSettingsEnableNotifications] forState:UIControlStateNormal];
|
||||
[masterBtnCell.mxkButton setTitle:[VectorL10n notificationSettingsEnableNotifications] forState:UIControlStateHighlighted];
|
||||
}
|
||||
else
|
||||
{
|
||||
[masterBtnCell.mxkButton setTitle:[MatrixKitL10n notificationSettingsDisableAll] forState:UIControlStateNormal];
|
||||
[masterBtnCell.mxkButton setTitle:[MatrixKitL10n notificationSettingsDisableAll] forState:UIControlStateHighlighted];
|
||||
[masterBtnCell.mxkButton setTitle:[VectorL10n notificationSettingsDisableAll] forState:UIControlStateNormal];
|
||||
[masterBtnCell.mxkButton setTitle:[VectorL10n notificationSettingsDisableAll] forState:UIControlStateHighlighted];
|
||||
}
|
||||
|
||||
[masterBtnCell.mxkButton addTarget:self action:@selector(onButtonPressed:) forControlEvents:UIControlEventTouchUpInside];
|
||||
@@ -342,12 +342,12 @@
|
||||
|
||||
if (areAllDisabled)
|
||||
{
|
||||
introCell.mxkTextView.text = [MatrixKitL10n notificationSettingsEnableNotificationsWarning];
|
||||
introCell.mxkTextView.text = [VectorL10n notificationSettingsEnableNotificationsWarning];
|
||||
introCell.mxkTextView.backgroundColor = [UIColor redColor];
|
||||
}
|
||||
else
|
||||
{
|
||||
introCell.mxkTextView.text = [MatrixKitL10n notificationSettingsGlobalInfo];
|
||||
introCell.mxkTextView.text = [VectorL10n notificationSettingsGlobalInfo];
|
||||
introCell.mxkTextView.backgroundColor = [UIColor clearColor];
|
||||
}
|
||||
|
||||
@@ -365,7 +365,7 @@
|
||||
{
|
||||
introCell = [[MXKTableViewCellWithTextView alloc] init];
|
||||
}
|
||||
introCell.mxkTextView.text = [MatrixKitL10n notificationSettingsPerWordInfo];
|
||||
introCell.mxkTextView.text = [VectorL10n notificationSettingsPerWordInfo];
|
||||
introCell.mxkTextView.font = [UIFont systemFontOfSize:14];
|
||||
|
||||
cell = introCell;
|
||||
@@ -474,37 +474,37 @@
|
||||
if (rowIndex == ruleContainsUserNameIndex)
|
||||
{
|
||||
pushRule = [_mxAccount.mxSession.notificationCenter ruleById:kMXNotificationCenterContainUserNameRuleID];
|
||||
ruleDescription = [MatrixKitL10n notificationSettingsContainMyUserName];
|
||||
ruleDescription = [VectorL10n notificationSettingsContainMyUserName];
|
||||
}
|
||||
if (rowIndex == ruleContainsDisplayNameIndex)
|
||||
{
|
||||
pushRule = [_mxAccount.mxSession.notificationCenter ruleById:kMXNotificationCenterContainDisplayNameRuleID];
|
||||
ruleDescription = [MatrixKitL10n notificationSettingsContainMyDisplayName];
|
||||
ruleDescription = [VectorL10n notificationSettingsContainMyDisplayName];
|
||||
}
|
||||
if (rowIndex == ruleOneToOneRoomIndex)
|
||||
{
|
||||
pushRule = [_mxAccount.mxSession.notificationCenter ruleById:kMXNotificationCenterOneToOneRoomRuleID];
|
||||
ruleDescription = [MatrixKitL10n notificationSettingsJustSentToMe];
|
||||
ruleDescription = [VectorL10n notificationSettingsJustSentToMe];
|
||||
}
|
||||
if (rowIndex == ruleInviteForMeIndex)
|
||||
{
|
||||
pushRule = [_mxAccount.mxSession.notificationCenter ruleById:kMXNotificationCenterInviteMeRuleID];
|
||||
ruleDescription = [MatrixKitL10n notificationSettingsInviteToANewRoom];
|
||||
ruleDescription = [VectorL10n notificationSettingsInviteToANewRoom];
|
||||
}
|
||||
if (rowIndex == ruleMemberEventIndex)
|
||||
{
|
||||
pushRule = [_mxAccount.mxSession.notificationCenter ruleById:kMXNotificationCenterMemberEventRuleID];
|
||||
ruleDescription = [MatrixKitL10n notificationSettingsPeopleJoinLeaveRooms];
|
||||
ruleDescription = [VectorL10n notificationSettingsPeopleJoinLeaveRooms];
|
||||
}
|
||||
if (rowIndex == ruleCallIndex)
|
||||
{
|
||||
pushRule = [_mxAccount.mxSession.notificationCenter ruleById:kMXNotificationCenterCallRuleID];
|
||||
ruleDescription = [MatrixKitL10n notificationSettingsReceiveACall];
|
||||
ruleDescription = [VectorL10n notificationSettingsReceiveACall];
|
||||
}
|
||||
if (rowIndex == ruleSuppressBotsNotificationsIndex)
|
||||
{
|
||||
pushRule = [_mxAccount.mxSession.notificationCenter ruleById:kMXNotificationCenterSuppressBotsNotificationsRuleID];
|
||||
ruleDescription = [MatrixKitL10n notificationSettingsSuppressFromBots];
|
||||
ruleDescription = [VectorL10n notificationSettingsSuppressFromBots];
|
||||
}
|
||||
|
||||
if (pushRule)
|
||||
@@ -536,7 +536,7 @@
|
||||
|
||||
pushRuleCell.mxSession = _mxAccount.mxSession;
|
||||
pushRuleCell.mxPushRule = pushRule;
|
||||
pushRuleCell.ruleDescription.text = [MatrixKitL10n notificationSettingsNotifyAllOther];
|
||||
pushRuleCell.ruleDescription.text = [VectorL10n notificationSettingsNotifyAllOther];
|
||||
|
||||
cell = pushRuleCell;
|
||||
}
|
||||
@@ -558,7 +558,7 @@
|
||||
{
|
||||
UITextView *textView = [[UITextView alloc] initWithFrame:CGRectMake(0, 0, tableView.frame.size.width, MAXFLOAT)];
|
||||
textView.font = [UIFont systemFontOfSize:14];
|
||||
textView.text = areAllDisabled ? [MatrixKitL10n notificationSettingsEnableNotificationsWarning] : [MatrixKitL10n notificationSettingsGlobalInfo];
|
||||
textView.text = areAllDisabled ? [VectorL10n notificationSettingsEnableNotificationsWarning] : [VectorL10n notificationSettingsGlobalInfo];
|
||||
CGSize contentSize = [textView sizeThatFits:textView.frame.size];
|
||||
return contentSize.height + 1;
|
||||
}
|
||||
@@ -569,7 +569,7 @@
|
||||
{
|
||||
UITextView *textView = [[UITextView alloc] initWithFrame:CGRectMake(0, 0, tableView.frame.size.width, MAXFLOAT)];
|
||||
textView.font = [UIFont systemFontOfSize:14];
|
||||
textView.text = [MatrixKitL10n notificationSettingsPerWordInfo];
|
||||
textView.text = [VectorL10n notificationSettingsPerWordInfo];
|
||||
CGSize contentSize = [textView sizeThatFits:textView.frame.size];
|
||||
return contentSize.height + 1;
|
||||
}
|
||||
@@ -612,23 +612,23 @@
|
||||
|
||||
if (section == MXKNOTIFICATIONSETTINGS_SECTION_PER_WORD_INDEX)
|
||||
{
|
||||
sectionLabel.text = [MatrixKitL10n notificationSettingsPerWordNotifications];
|
||||
sectionLabel.text = [VectorL10n notificationSettingsPerWordNotifications];
|
||||
}
|
||||
else if (section == MXKNOTIFICATIONSETTINGS_SECTION_PER_ROOM_INDEX)
|
||||
{
|
||||
sectionLabel.text = [MatrixKitL10n notificationSettingsPerRoomNotifications];
|
||||
sectionLabel.text = [VectorL10n notificationSettingsPerRoomNotifications];
|
||||
}
|
||||
else if (section == MXKNOTIFICATIONSETTINGS_SECTION_PER_SENDER_INDEX)
|
||||
{
|
||||
sectionLabel.text = [MatrixKitL10n notificationSettingsPerSenderNotifications];
|
||||
sectionLabel.text = [VectorL10n notificationSettingsPerSenderNotifications];
|
||||
}
|
||||
else if (section == MXKNOTIFICATIONSETTINGS_SECTION_OTHERS_INDEX)
|
||||
{
|
||||
sectionLabel.text = [MatrixKitL10n notificationSettingsOtherAlerts];
|
||||
sectionLabel.text = [VectorL10n notificationSettingsOtherAlerts];
|
||||
}
|
||||
else if (section == MXKNOTIFICATIONSETTINGS_SECTION_DEFAULT_INDEX)
|
||||
{
|
||||
sectionLabel.text = [MatrixKitL10n notificationSettingsByDefault];
|
||||
sectionLabel.text = [VectorL10n notificationSettingsByDefault];
|
||||
}
|
||||
|
||||
return sectionHeader;
|
||||
|
||||
@@ -41,8 +41,9 @@ limitations under the License.
|
||||
|
||||
@param recentListViewController the `MXKRecentListViewController` instance.
|
||||
@param childInfo the `MXSpaceChildInfo` instance that describes the selected room.
|
||||
@param sourceView the view the modal has to be presented from.
|
||||
*/
|
||||
-(void)recentListViewController:(MXKRecentListViewController *)recentListViewController didSelectSuggestedRoom:(MXSpaceChildInfo *)childInfo;
|
||||
-(void)recentListViewController:(MXKRecentListViewController *)recentListViewController didSelectSuggestedRoom:(MXSpaceChildInfo *)childInfo from:(UIView* _Nullable)sourceView;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@@ -97,6 +97,8 @@
|
||||
[[[self class] nib] instantiateWithOwner:self options:nil];
|
||||
}
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated"
|
||||
// Adjust search bar Top constraint to take into account potential navBar.
|
||||
if (_recentsSearchBarTopConstraint)
|
||||
{
|
||||
@@ -126,6 +128,7 @@
|
||||
|
||||
_recentsTableViewBottomConstraint.active = YES;
|
||||
}
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
// Hide search bar by default
|
||||
[self hideSearchBar:YES];
|
||||
@@ -166,9 +169,6 @@
|
||||
|
||||
// Observe the server sync
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onSyncNotification) name:kMXSessionDidSyncNotification object:nil];
|
||||
|
||||
// Do a full reload
|
||||
[self refreshRecentsTable];
|
||||
}
|
||||
|
||||
- (void)viewWillDisappear:(BOOL)animated
|
||||
@@ -177,12 +177,6 @@
|
||||
|
||||
// The user may still press search button whereas the view disappears
|
||||
ignoreSearchRequest = YES;
|
||||
|
||||
// Leave potential search session
|
||||
if (!self.recentsSearchBar.isHidden)
|
||||
{
|
||||
[self searchBarCancelButtonClicked:self.recentsSearchBar];
|
||||
}
|
||||
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self name:kMXKRoomDataSourceSyncStatusChanged object:nil];
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self name:kMXSessionDidSyncNotification object:nil];
|
||||
@@ -217,7 +211,7 @@
|
||||
if ([MXKRoomDataSourceManager sharedManagerForMatrixSession:mxSession].isServerSyncInProgress)
|
||||
{
|
||||
// sync is in progress for at least one data source, keep running the loading wheel
|
||||
[self.activityIndicator startAnimating];
|
||||
[self startActivityIndicator];
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -229,6 +223,8 @@
|
||||
self.keyboardView = _recentsSearchBar.inputAccessoryView.superview;
|
||||
}
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated"
|
||||
- (void)setKeyboardHeight:(CGFloat)keyboardHeight
|
||||
{
|
||||
// Deduce the bottom constraint for the table view (Don't forget the potential tabBar)
|
||||
@@ -245,6 +241,7 @@
|
||||
// Force layout immediately to take into account new constraint
|
||||
[self.view layoutIfNeeded];
|
||||
}
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
- (void)destroy
|
||||
{
|
||||
@@ -421,7 +418,9 @@
|
||||
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
|
||||
{
|
||||
// Let dataSource provide the section header.
|
||||
return [dataSource viewForHeaderInSection:section withFrame:[tableView rectForHeaderInSection:section]];
|
||||
return [dataSource viewForHeaderInSection:section
|
||||
withFrame:[tableView rectForHeaderInSection:section]
|
||||
inTableView:tableView];
|
||||
}
|
||||
|
||||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
@@ -443,7 +442,8 @@
|
||||
if (recentCellData.isSuggestedRoom)
|
||||
{
|
||||
[_delegate recentListViewController:self
|
||||
didSelectSuggestedRoom:recentCellData.roomSummary.spaceChildInfo];
|
||||
didSelectSuggestedRoom:recentCellData.roomSummary.spaceChildInfo
|
||||
from:selectedCell];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -320,9 +320,9 @@
|
||||
[currentAlert dismissViewControllerAnimated:NO completion:nil];
|
||||
}
|
||||
|
||||
currentAlert = [UIAlertController alertControllerWithTitle:[MatrixKitL10n roomMemberIgnorePrompt] message:nil preferredStyle:UIAlertControllerStyleAlert];
|
||||
currentAlert = [UIAlertController alertControllerWithTitle:[VectorL10n roomMemberIgnorePrompt] message:nil preferredStyle:UIAlertControllerStyleAlert];
|
||||
|
||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n yes]
|
||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n yes]
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction * action) {
|
||||
|
||||
@@ -357,7 +357,7 @@
|
||||
|
||||
}]];
|
||||
|
||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n no]
|
||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n no]
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction * action) {
|
||||
|
||||
@@ -768,49 +768,49 @@
|
||||
switch (action)
|
||||
{
|
||||
case MXKRoomMemberDetailsActionInvite:
|
||||
title = [MatrixKitL10n invite];
|
||||
title = [VectorL10n invite];
|
||||
break;
|
||||
case MXKRoomMemberDetailsActionLeave:
|
||||
title = [MatrixKitL10n leave];
|
||||
title = [VectorL10n leave];
|
||||
break;
|
||||
case MXKRoomMemberDetailsActionKick:
|
||||
title = [MatrixKitL10n kick];
|
||||
title = [VectorL10n kick];
|
||||
break;
|
||||
case MXKRoomMemberDetailsActionBan:
|
||||
title = [MatrixKitL10n ban];
|
||||
title = [VectorL10n ban];
|
||||
break;
|
||||
case MXKRoomMemberDetailsActionUnban:
|
||||
title = [MatrixKitL10n unban];
|
||||
title = [VectorL10n unban];
|
||||
break;
|
||||
case MXKRoomMemberDetailsActionIgnore:
|
||||
title = [MatrixKitL10n ignore];
|
||||
title = [VectorL10n ignore];
|
||||
break;
|
||||
case MXKRoomMemberDetailsActionUnignore:
|
||||
title = [MatrixKitL10n unignore];
|
||||
title = [VectorL10n unignore];
|
||||
break;
|
||||
case MXKRoomMemberDetailsActionSetDefaultPowerLevel:
|
||||
title = [MatrixKitL10n setDefaultPowerLevel];
|
||||
title = [VectorL10n setDefaultPowerLevel];
|
||||
break;
|
||||
case MXKRoomMemberDetailsActionSetModerator:
|
||||
title = [MatrixKitL10n setModerator];
|
||||
title = [VectorL10n setModerator];
|
||||
break;
|
||||
case MXKRoomMemberDetailsActionSetAdmin:
|
||||
title = [MatrixKitL10n setAdmin];
|
||||
title = [VectorL10n setAdmin];
|
||||
break;
|
||||
case MXKRoomMemberDetailsActionSetCustomPowerLevel:
|
||||
title = [MatrixKitL10n setPowerLevel];
|
||||
title = [VectorL10n setPowerLevel];
|
||||
break;
|
||||
case MXKRoomMemberDetailsActionStartChat:
|
||||
title = [MatrixKitL10n startChat];
|
||||
title = [VectorL10n startChat];
|
||||
break;
|
||||
case MXKRoomMemberDetailsActionStartVoiceCall:
|
||||
title = [MatrixKitL10n startVoiceCall];
|
||||
title = [VectorL10n startVoiceCall];
|
||||
break;
|
||||
case MXKRoomMemberDetailsActionStartVideoCall:
|
||||
title = [MatrixKitL10n startVideoCall];
|
||||
title = [VectorL10n startVideoCall];
|
||||
break;
|
||||
case MXKRoomMemberDetailsActionMention:
|
||||
title = [MatrixKitL10n mention];
|
||||
title = [VectorL10n mention];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -918,9 +918,9 @@
|
||||
[currentAlert dismissViewControllerAnimated:NO completion:nil];
|
||||
}
|
||||
|
||||
currentAlert = [UIAlertController alertControllerWithTitle:[MatrixKitL10n roomMemberPowerLevelPrompt] message:nil preferredStyle:UIAlertControllerStyleAlert];
|
||||
currentAlert = [UIAlertController alertControllerWithTitle:[VectorL10n roomMemberPowerLevelPrompt] message:nil preferredStyle:UIAlertControllerStyleAlert];
|
||||
|
||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n no]
|
||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n no]
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction * action) {
|
||||
|
||||
@@ -932,7 +932,7 @@
|
||||
|
||||
}]];
|
||||
|
||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n yes]
|
||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n yes]
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction * action) {
|
||||
|
||||
@@ -983,12 +983,12 @@
|
||||
[currentAlert dismissViewControllerAnimated:NO completion:nil];
|
||||
}
|
||||
|
||||
currentAlert = [UIAlertController alertControllerWithTitle:[MatrixKitL10n powerLevel] message:nil preferredStyle:UIAlertControllerStyleAlert];
|
||||
currentAlert = [UIAlertController alertControllerWithTitle:[VectorL10n powerLevel] message:nil preferredStyle:UIAlertControllerStyleAlert];
|
||||
|
||||
|
||||
if (![self.mainSession.myUser.userId isEqualToString:_mxRoomMember.userId])
|
||||
{
|
||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n resetToDefault]
|
||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n resetToDefault]
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction * action) {
|
||||
|
||||
@@ -1013,7 +1013,7 @@
|
||||
textField.keyboardType = UIKeyboardTypeDecimalPad;
|
||||
}];
|
||||
|
||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n ok]
|
||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n ok]
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction * action) {
|
||||
|
||||
|
||||
@@ -105,6 +105,8 @@
|
||||
// Adjust Top and Bottom constraints to take into account potential navBar and tabBar.
|
||||
[NSLayoutConstraint deactivateConstraints:@[_membersSearchBarTopConstraint, _membersTableViewBottomConstraint]];
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated"
|
||||
_membersSearchBarTopConstraint = [NSLayoutConstraint constraintWithItem:self.topLayoutGuide
|
||||
attribute:NSLayoutAttributeBottom
|
||||
relatedBy:NSLayoutRelationEqual
|
||||
@@ -120,6 +122,7 @@
|
||||
attribute:NSLayoutAttributeBottom
|
||||
multiplier:1.0f
|
||||
constant:0.0f];
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
[NSLayoutConstraint activateConstraints:@[_membersSearchBarTopConstraint, _membersTableViewBottomConstraint]];
|
||||
|
||||
@@ -225,6 +228,8 @@
|
||||
self.keyboardView = _membersSearchBar.inputAccessoryView.superview;
|
||||
}
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated"
|
||||
- (void)setKeyboardHeight:(CGFloat)keyboardHeight
|
||||
{
|
||||
// Deduce the bottom constraint for the table view (Don't forget the potential tabBar)
|
||||
@@ -241,6 +246,7 @@
|
||||
// Force layout immediately to take into account new constraint
|
||||
[self.view layoutIfNeeded];
|
||||
}
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
- (void)destroy
|
||||
{
|
||||
@@ -510,10 +516,10 @@
|
||||
}
|
||||
|
||||
// Ask for userId to invite
|
||||
currentAlert = [UIAlertController alertControllerWithTitle:[MatrixKitL10n userIdTitle] message:nil preferredStyle:UIAlertControllerStyleAlert];
|
||||
currentAlert = [UIAlertController alertControllerWithTitle:[VectorL10n userIdTitle] message:nil preferredStyle:UIAlertControllerStyleAlert];
|
||||
|
||||
|
||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n cancel]
|
||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n cancel]
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction * action) {
|
||||
|
||||
@@ -529,10 +535,10 @@
|
||||
[currentAlert addTextFieldWithConfigurationHandler:^(UITextField *textField)
|
||||
{
|
||||
textField.secureTextEntry = NO;
|
||||
textField.placeholder = [MatrixKitL10n userIdPlaceholder];
|
||||
textField.placeholder = [VectorL10n userIdPlaceholder];
|
||||
}];
|
||||
|
||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[MatrixKitL10n invite]
|
||||
[currentAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n invite]
|
||||
style:UIAlertActionStyleDefault
|
||||
handler:^(UIAlertAction * action) {
|
||||
|
||||
|
||||
@@ -182,7 +182,7 @@
|
||||
}];
|
||||
}
|
||||
|
||||
self.title = [MatrixKitL10n roomDetailsTitle];
|
||||
self.title = [VectorL10n roomDetailsTitle];
|
||||
}
|
||||
|
||||
- (void)refreshRoomSettings
|
||||
|
||||
@@ -76,6 +76,8 @@
|
||||
// Adjust Top and Bottom constraints to take into account potential navBar and tabBar.
|
||||
[NSLayoutConstraint deactivateConstraints:@[_searchSearchBarTopConstraint, _searchTableViewBottomConstraint]];
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated"
|
||||
_searchSearchBarTopConstraint = [NSLayoutConstraint constraintWithItem:self.topLayoutGuide
|
||||
attribute:NSLayoutAttributeBottom
|
||||
relatedBy:NSLayoutRelationEqual
|
||||
@@ -91,6 +93,7 @@
|
||||
attribute:NSLayoutAttributeBottom
|
||||
multiplier:1.0f
|
||||
constant:0.0f];
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
[NSLayoutConstraint activateConstraints:@[_searchSearchBarTopConstraint, _searchTableViewBottomConstraint]];
|
||||
|
||||
@@ -99,7 +102,7 @@
|
||||
self.searchSearchBarHeightConstraint.constant = 0;
|
||||
[self.view setNeedsUpdateConstraints];
|
||||
|
||||
self.noResultsLabel.text = [MatrixKitL10n searchNoResults];
|
||||
self.noResultsLabel.text = [VectorL10n searchNoResults];
|
||||
self.noResultsLabel.hidden = YES;
|
||||
|
||||
searchBarButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemSearch target:self action:@selector(showSearchBar:)];
|
||||
@@ -140,6 +143,8 @@
|
||||
self.keyboardView = _searchSearchBar.inputAccessoryView.superview;
|
||||
}
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated"
|
||||
- (void)setKeyboardHeight:(CGFloat)keyboardHeight
|
||||
{
|
||||
// Deduce the bottom constraint for the table view (Don't forget the potential tabBar)
|
||||
@@ -156,6 +161,7 @@
|
||||
// Force layout immediately to take into account new constraint
|
||||
[self.view layoutIfNeeded];
|
||||
}
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
- (void)destroy
|
||||
{
|
||||
|
||||
@@ -492,21 +492,16 @@ const CGFloat MXKViewControllerMaxExternalKeyboardHeight = 80;
|
||||
|
||||
#pragma mark - Activity indicator
|
||||
|
||||
- (void)stopActivityIndicator
|
||||
{
|
||||
- (BOOL)canStopActivityIndicator {
|
||||
// Check whether all conditions are satisfied before stopping loading wheel
|
||||
BOOL isActivityInProgress = NO;
|
||||
for (MXSession *mxSession in mxSessionArray)
|
||||
{
|
||||
if (mxSession.shouldShowActivityIndicator)
|
||||
{
|
||||
isActivityInProgress = YES;
|
||||
return NO;
|
||||
}
|
||||
}
|
||||
if (!isActivityInProgress)
|
||||
{
|
||||
[super stopActivityIndicator];
|
||||
}
|
||||
return [super canStopActivityIndicator];
|
||||
}
|
||||
|
||||
#pragma mark - Shake handling
|
||||
|
||||
@@ -35,6 +35,14 @@
|
||||
*/
|
||||
@property (nonatomic) UIActivityIndicatorView *activityIndicator;
|
||||
|
||||
/**
|
||||
A view controller may choose to implement a completely custom activity indicator (e.g. shared toast notification),
|
||||
|
||||
In this case the default `activityIndicator` will be hidden, and the view controller is responsible for overriding
|
||||
`startActivityIndicator` and `stopActivityIndicator` methods to show / hide the custom activity indicator.
|
||||
*/
|
||||
@property (nonatomic, readonly) BOOL providesCustomActivityIndicator;
|
||||
|
||||
/**
|
||||
Bring the activity indicator to the front and start it.
|
||||
*/
|
||||
|
||||
@@ -133,6 +133,9 @@ NSString *const kMXKWebViewViewControllerJavaScriptEnableLog =
|
||||
multiplier:1.0
|
||||
constant:0];
|
||||
// Force webview in full height
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated"
|
||||
NSLayoutConstraint *topConstraint = [NSLayoutConstraint constraintWithItem:webView
|
||||
attribute:NSLayoutAttributeTop
|
||||
relatedBy:NSLayoutRelationEqual
|
||||
@@ -147,10 +150,11 @@ NSString *const kMXKWebViewViewControllerJavaScriptEnableLog =
|
||||
attribute:NSLayoutAttributeTop
|
||||
multiplier:1.0
|
||||
constant:0];
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
[NSLayoutConstraint activateConstraints:@[leftConstraint, rightConstraint, topConstraint, bottomConstraint]];
|
||||
|
||||
backButton = [[UIBarButtonItem alloc] initWithTitle:[MatrixKitL10n back] style:UIBarButtonItemStylePlain target:self action:@selector(goBack)];
|
||||
backButton = [[UIBarButtonItem alloc] initWithTitle:[VectorL10n back] style:UIBarButtonItemStylePlain target:self action:@selector(goBack)];
|
||||
|
||||
if (_URL.length)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user