mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-05-18 13:42:14 +02:00
Merge remote-tracking branch 'origin/develop' into auth_forgot_password
This commit is contained in:
+14
-2
@@ -561,8 +561,11 @@
|
||||
// Dispatch the completion in order to let navigation stack refresh itself
|
||||
// It is required to display the auth VC at startup
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
completion();
|
||||
});
|
||||
if (completion)
|
||||
{
|
||||
completion();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1164,6 +1167,15 @@
|
||||
[self logout];
|
||||
}
|
||||
}];
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserverForName:kMXSessionIgnoredUsersDidChangeNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification * _Nonnull notif) {
|
||||
|
||||
NSLog(@"[AppDelegate] kMXSessionIgnoredUsersDidChangeNotification received. Reload the app");
|
||||
|
||||
// Reload entirely the app when a user has been ignored or unignored
|
||||
[[AppDelegate theDelegate] reloadMatrixSessions:YES];
|
||||
|
||||
}];
|
||||
|
||||
// Observe settings changes
|
||||
[[MXKAppSettings standardAppSettings] addObserver:self forKeyPath:@"showAllEventsInRoomHistory" options:0 context:nil];
|
||||
|
||||
@@ -133,8 +133,10 @@
|
||||
"room_participants_action_invite" = "Invite";
|
||||
"room_participants_action_leave" = "Leave this room";
|
||||
"room_participants_action_remove" = "Remove from this room";
|
||||
"room_participants_action_ban" = "Block";
|
||||
"room_participants_action_unban" = "Unblock";
|
||||
"room_participants_action_ban" = "Ban from this room";
|
||||
"room_participants_action_unban" = "Unban";
|
||||
"room_participants_action_ignore" = "Hide all messages from this user";
|
||||
"room_participants_action_unignore" = "Show all messages from this user";
|
||||
"room_participants_action_set_default_power_level" = "Reset to normal user";
|
||||
"room_participants_action_set_moderator" = "Make moderator";
|
||||
"room_participants_action_set_admin" = "Make admin";
|
||||
@@ -156,6 +158,9 @@
|
||||
"room_event_action_share" = "Share";
|
||||
"room_event_action_redact" = "Redact";
|
||||
"room_event_action_permalink" = "Permalink";
|
||||
"room_event_action_report" = "Report content";
|
||||
"room_event_action_report_prompt_reason" = "Reason for reporting this content";
|
||||
"room_event_action_report_prompt_ignore_user" = "Do you want to hide all messages from this user?";
|
||||
"room_event_action_save" = "Save";
|
||||
"room_event_action_resend" = "Resend";
|
||||
"room_event_action_delete" = "Delete";
|
||||
@@ -198,7 +203,7 @@
|
||||
"settings_phone_number" = "Phone Number";
|
||||
"settings_night_mode" = "Night Mode";
|
||||
|
||||
"settings_enable_push_notif" = "Enable notifications on your device";
|
||||
"settings_enable_push_notif" = "Notifications on this device";
|
||||
"settings_global_settings_info" = "Global notification settings are available on your Vector web client";
|
||||
//"settings_enable_all_notif" = "Enable all notifications";
|
||||
//"settings_messages_my_display_name" = "Msg containing my display name";
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9532" systemVersion="15C50" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="H1p-Uh-vWS">
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10116" systemVersion="15C50" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="H1p-Uh-vWS">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9530"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--RecentsNav-->
|
||||
@@ -37,12 +37,31 @@
|
||||
<outlet property="roomTitleViewContainer" destination="aas-th-FW1" id="SFz-1s-ywg"/>
|
||||
<segue destination="e7G-NU-7ck" kind="show" identifier="showRoomDetails" id="vCz-dl-6xQ"/>
|
||||
<segue destination="KDg-aD-xlK" kind="show" identifier="showRoomSearch" id="hdA-V1-9AF"/>
|
||||
<segue destination="nDS-pp-sWM" kind="show" identifier="showMemberDetails" id="cUw-vU-gJq"/>
|
||||
</connections>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="94y-cU-qQD" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="1384" y="-1063"/>
|
||||
</scene>
|
||||
<!--Room Member Details View Controller-->
|
||||
<scene sceneID="eq5-qi-gDd">
|
||||
<objects>
|
||||
<viewController id="nDS-pp-sWM" customClass="RoomMemberDetailsViewController" sceneMemberID="viewController">
|
||||
<layoutGuides>
|
||||
<viewControllerLayoutGuide type="top" id="AgI-3V-llt"/>
|
||||
<viewControllerLayoutGuide type="bottom" id="6ie-9b-cBo"/>
|
||||
</layoutGuides>
|
||||
<view key="view" contentMode="scaleToFill" id="N8z-LO-417">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="e8Z-uW-oDv" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="3326" y="-2175"/>
|
||||
</scene>
|
||||
<!--Room Context Timeline-->
|
||||
<scene sceneID="Htr-h8-baq">
|
||||
<objects>
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>0.1.5</string>
|
||||
<string>0.1.6</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
|
||||
@@ -28,9 +28,13 @@
|
||||
*/
|
||||
+ (NSString*)presenceText:(MXUser*)user;
|
||||
|
||||
|
||||
#pragma mark - Universal link
|
||||
|
||||
/**
|
||||
The url of the Vector web application.
|
||||
*/
|
||||
+ (NSString*)webAppUrl;
|
||||
|
||||
/**
|
||||
Detect if a URL is a universal link for the application.
|
||||
|
||||
|
||||
@@ -61,6 +61,13 @@
|
||||
|
||||
#pragma mark - Universal link
|
||||
|
||||
+ (NSString *)webAppUrl
|
||||
{
|
||||
// FIXME: When available, use the prod Vector web app URL
|
||||
return [[NSUserDefaults standardUserDefaults] objectForKey:@"webAppUrlBeta"];
|
||||
//return [[NSUserDefaults standardUserDefaults] objectForKey:@"webAppUrlDev"];
|
||||
}
|
||||
|
||||
+ (BOOL)isUniversalLink:(NSURL*)url
|
||||
{
|
||||
BOOL isUniversalLink = NO;
|
||||
|
||||
@@ -11,11 +11,13 @@
|
||||
<key>identityserverurl</key>
|
||||
<string>https://vector.im</string>
|
||||
<key>homeserverurl</key>
|
||||
<string>https://matrix.org</string>
|
||||
<string>https://vector.im</string>
|
||||
<key>homeserver</key>
|
||||
<string>matrix.org</string>
|
||||
<key>webAppUrlDev</key>
|
||||
<string>https://vector.im/develop</string>
|
||||
<key>webAppUrlBeta</key>
|
||||
<string>https://vector.im/beta</string>
|
||||
<key>apnsDeviceToken</key>
|
||||
<string></string>
|
||||
<key>showAllEventsInRoomHistory</key>
|
||||
|
||||
@@ -23,6 +23,17 @@
|
||||
|
||||
#import "VectorDesignValues.h"
|
||||
|
||||
@interface AuthenticationViewController ()
|
||||
{
|
||||
/**
|
||||
Store the potential login error received by using the new default homeserver (vector.im)
|
||||
while we retry a login process against the matrix.org HS.
|
||||
*/
|
||||
NSError *loginError;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation AuthenticationViewController
|
||||
|
||||
+ (UINib *)nib
|
||||
@@ -232,6 +243,48 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (void)onFailureDuringAuthRequest:(NSError *)error
|
||||
{
|
||||
// Homeserver migration: the default homeserver url has been updated with https://vector.im.
|
||||
// The login process with an existing matrix.org accounts will then fail.
|
||||
// Patch: Falling back to matrix.org HS so we don't break everyone's logins
|
||||
if (self.authType == MXKAuthenticationTypeLogin)
|
||||
{
|
||||
if ([self.homeServerTextField.text isEqualToString:@"https://vector.im"])
|
||||
{
|
||||
MXError *mxError = [[MXError alloc] initWithNSError:error];
|
||||
if (mxError && [mxError.errcode isEqualToString:kMXErrCodeStringForbidden])
|
||||
{
|
||||
// Retry against the matrix.org HS
|
||||
NSLog(@"[MXKAuthenticationVC] Falling back to matrix.org HS");
|
||||
|
||||
loginError = error;
|
||||
[self setHomeServerTextFieldText:@"https://matrix.org"];
|
||||
|
||||
[self onButtonPressed:self.submitButton];
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (loginError)
|
||||
{
|
||||
// This is not an existing matrix.org accounts
|
||||
NSLog(@"[MXKAuthenticationVC] This is not an existing matrix.org accounts");
|
||||
|
||||
// Restore the default HS
|
||||
[self setHomeServerTextFieldText: @"https://vector.im"];
|
||||
|
||||
// Consider the original login error
|
||||
[super onFailureDuringAuthRequest:loginError];
|
||||
loginError = nil;
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
[super onFailureDuringAuthRequest:loginError];
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
|
||||
- (void)hideServerOptionsContainer:(BOOL)hidden
|
||||
|
||||
@@ -358,8 +358,22 @@
|
||||
{
|
||||
[actionsArray addObject:@(MXKRoomMemberDetailsActionBan)];
|
||||
}
|
||||
|
||||
// Check whether the option Ignore may be presented
|
||||
if (self.mxRoomMember.membership == MXMembershipJoin)
|
||||
{
|
||||
// is he already ignored ?
|
||||
if (![self.mainSession isUserIgnored:self.mxRoomMember.userId])
|
||||
{
|
||||
[actionsArray addObject:@(MXKRoomMemberDetailsActionIgnore)];
|
||||
}
|
||||
else
|
||||
{
|
||||
[actionsArray addObject:@(MXKRoomMemberDetailsActionUnignore)];
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
case MXMembershipLeave:
|
||||
{
|
||||
// Check conditions to be able to invite someone
|
||||
@@ -414,6 +428,12 @@
|
||||
case MXKRoomMemberDetailsActionUnban:
|
||||
title = NSLocalizedStringFromTable(@"room_participants_action_unban", @"Vector", nil);
|
||||
break;
|
||||
case MXKRoomMemberDetailsActionIgnore:
|
||||
title = NSLocalizedStringFromTable(@"room_participants_action_ignore", @"Vector", nil);
|
||||
break;
|
||||
case MXKRoomMemberDetailsActionUnignore:
|
||||
title = NSLocalizedStringFromTable(@"room_participants_action_unignore", @"Vector", nil);
|
||||
break;
|
||||
case MXKRoomMemberDetailsActionSetDefaultPowerLevel:
|
||||
title = NSLocalizedStringFromTable(@"room_participants_action_set_default_power_level", @"Vector", nil);
|
||||
break;
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#import "PreviewRoomTitleView.h"
|
||||
|
||||
#import "RoomParticipantsViewController.h"
|
||||
#import "RoomMemberDetailsViewController.h"
|
||||
|
||||
#import "SegmentedViewController.h"
|
||||
#import "RoomSettingsViewController.h"
|
||||
@@ -97,8 +98,6 @@
|
||||
CGPoint startScrollingPoint;
|
||||
}
|
||||
|
||||
@property (strong, nonatomic) MXKAlert *currentAlert;
|
||||
|
||||
@end
|
||||
|
||||
@implementation RoomViewController
|
||||
@@ -276,10 +275,10 @@
|
||||
[super viewWillDisappear:animated];
|
||||
|
||||
// hide action
|
||||
if (self.currentAlert)
|
||||
if (currentAlert)
|
||||
{
|
||||
[self.currentAlert dismiss:NO];
|
||||
self.currentAlert = nil;
|
||||
[currentAlert dismiss:NO];
|
||||
currentAlert = nil;
|
||||
}
|
||||
|
||||
[self removeTypingNotificationsListener];
|
||||
@@ -569,10 +568,10 @@
|
||||
{
|
||||
self.navigationItem.rightBarButtonItem.enabled = NO;
|
||||
|
||||
if (self.currentAlert)
|
||||
if (currentAlert)
|
||||
{
|
||||
[self.currentAlert dismiss:NO];
|
||||
self.currentAlert = nil;
|
||||
[currentAlert dismiss:NO];
|
||||
currentAlert = nil;
|
||||
}
|
||||
|
||||
if (customizedRoomDataSource)
|
||||
@@ -1047,7 +1046,15 @@
|
||||
// Handle here user actions on bubbles for Vector app
|
||||
if (customizedRoomDataSource)
|
||||
{
|
||||
if ([actionIdentifier isEqualToString:kMXKRoomBubbleCellTapOnMessageTextView] || [actionIdentifier isEqualToString:kMXKRoomBubbleCellTapOnContentView])
|
||||
if ([actionIdentifier isEqualToString:kMXKRoomBubbleCellTapOnAvatarView])
|
||||
{
|
||||
selectedRoomMember = [self.roomDataSource.room.state memberWithUserId:userInfo[kMXKRoomBubbleCellUserIdKey]];
|
||||
if (selectedRoomMember)
|
||||
{
|
||||
[self performSegueWithIdentifier:@"showMemberDetails" sender:self];
|
||||
}
|
||||
}
|
||||
else if ([actionIdentifier isEqualToString:kMXKRoomBubbleCellTapOnMessageTextView] || [actionIdentifier isEqualToString:kMXKRoomBubbleCellTapOnContentView])
|
||||
{
|
||||
// Retrieve the tapped event
|
||||
MXEvent *tappedEvent = userInfo[kMXKRoomBubbleCellEventKey];
|
||||
@@ -1081,19 +1088,19 @@
|
||||
|
||||
if (selectedEvent)
|
||||
{
|
||||
if (self.currentAlert)
|
||||
if (currentAlert)
|
||||
{
|
||||
[self.currentAlert dismiss:NO];
|
||||
self.currentAlert = nil;
|
||||
[currentAlert dismiss:NO];
|
||||
currentAlert = nil;
|
||||
}
|
||||
|
||||
__weak __typeof(self) weakSelf = self;
|
||||
self.currentAlert = [[MXKAlert alloc] initWithTitle:nil message:nil style:MXKAlertStyleActionSheet];
|
||||
currentAlert = [[MXKAlert alloc] initWithTitle:nil message:nil style:MXKAlertStyleActionSheet];
|
||||
|
||||
// Add actions for a failed event
|
||||
if (selectedEvent.mxkState == MXKEventStateSendingFailed)
|
||||
{
|
||||
[self.currentAlert addActionWithTitle:NSLocalizedStringFromTable(@"room_event_action_resend", @"Vector", nil) style:MXKAlertActionStyleDefault handler:^(MXKAlert *alert) {
|
||||
[currentAlert addActionWithTitle:NSLocalizedStringFromTable(@"room_event_action_resend", @"Vector", nil) style:MXKAlertActionStyleDefault handler:^(MXKAlert *alert) {
|
||||
|
||||
__strong __typeof(weakSelf)strongSelf = weakSelf;
|
||||
[strongSelf cancelEventSelection];
|
||||
@@ -1103,7 +1110,7 @@
|
||||
|
||||
}];
|
||||
|
||||
[self.currentAlert addActionWithTitle:NSLocalizedStringFromTable(@"room_event_action_delete", @"Vector", nil) style:MXKAlertActionStyleDefault handler:^(MXKAlert *alert) {
|
||||
[currentAlert addActionWithTitle:NSLocalizedStringFromTable(@"room_event_action_delete", @"Vector", nil) style:MXKAlertActionStyleDefault handler:^(MXKAlert *alert) {
|
||||
|
||||
__strong __typeof(weakSelf)strongSelf = weakSelf;
|
||||
[strongSelf cancelEventSelection];
|
||||
@@ -1127,7 +1134,7 @@
|
||||
selectedComponent = nil;
|
||||
}
|
||||
|
||||
[self.currentAlert addActionWithTitle:NSLocalizedStringFromTable(@"room_event_action_copy", @"Vector", nil) style:MXKAlertActionStyleDefault handler:^(MXKAlert *alert) {
|
||||
[currentAlert addActionWithTitle:NSLocalizedStringFromTable(@"room_event_action_copy", @"Vector", nil) style:MXKAlertActionStyleDefault handler:^(MXKAlert *alert) {
|
||||
|
||||
__strong __typeof(weakSelf)strongSelf = weakSelf;
|
||||
[strongSelf cancelEventSelection];
|
||||
@@ -1136,7 +1143,7 @@
|
||||
|
||||
}];
|
||||
|
||||
[self.currentAlert addActionWithTitle:NSLocalizedStringFromTable(@"room_event_action_share", @"Vector", nil) style:MXKAlertActionStyleDefault handler:^(MXKAlert *alert) {
|
||||
[currentAlert addActionWithTitle:NSLocalizedStringFromTable(@"room_event_action_share", @"Vector", nil) style:MXKAlertActionStyleDefault handler:^(MXKAlert *alert) {
|
||||
|
||||
__strong __typeof(weakSelf)strongSelf = weakSelf;
|
||||
[strongSelf cancelEventSelection];
|
||||
@@ -1157,7 +1164,7 @@
|
||||
{
|
||||
if (attachment.type == MXKAttachmentTypeImage || attachment.type == MXKAttachmentTypeVideo)
|
||||
{
|
||||
[self.currentAlert addActionWithTitle:NSLocalizedStringFromTable(@"room_event_action_save", @"Vector", nil) style:MXKAlertActionStyleDefault handler:^(MXKAlert *alert) {
|
||||
[currentAlert addActionWithTitle:NSLocalizedStringFromTable(@"room_event_action_save", @"Vector", nil) style:MXKAlertActionStyleDefault handler:^(MXKAlert *alert) {
|
||||
|
||||
__strong __typeof(weakSelf)strongSelf = weakSelf;
|
||||
[strongSelf cancelEventSelection];
|
||||
@@ -1185,7 +1192,7 @@
|
||||
}];
|
||||
}
|
||||
|
||||
[self.currentAlert addActionWithTitle:NSLocalizedStringFromTable(@"room_event_action_copy", @"Vector", nil) style:MXKAlertActionStyleDefault handler:^(MXKAlert *alert) {
|
||||
[currentAlert addActionWithTitle:NSLocalizedStringFromTable(@"room_event_action_copy", @"Vector", nil) style:MXKAlertActionStyleDefault handler:^(MXKAlert *alert) {
|
||||
|
||||
__strong __typeof(weakSelf)strongSelf = weakSelf;
|
||||
[strongSelf cancelEventSelection];
|
||||
@@ -1211,7 +1218,7 @@
|
||||
[roomBubbleTableViewCell startProgressUI];
|
||||
}];
|
||||
|
||||
[self.currentAlert addActionWithTitle:NSLocalizedStringFromTable(@"room_event_action_share", @"Vector", nil) style:MXKAlertActionStyleDefault handler:^(MXKAlert *alert) {
|
||||
[currentAlert addActionWithTitle:NSLocalizedStringFromTable(@"room_event_action_share", @"Vector", nil) style:MXKAlertActionStyleDefault handler:^(MXKAlert *alert) {
|
||||
|
||||
__strong __typeof(weakSelf)strongSelf = weakSelf;
|
||||
[strongSelf cancelEventSelection];
|
||||
@@ -1249,7 +1256,7 @@
|
||||
NSString *uploadId = roomBubbleTableViewCell.bubbleData.attachment.actualURL;
|
||||
if ([MXKMediaManager existingUploaderWithId:uploadId])
|
||||
{
|
||||
[self.currentAlert addActionWithTitle:NSLocalizedStringFromTable(@"room_event_action_cancel_upload", @"Vector", nil) style:MXKAlertActionStyleDefault handler:^(MXKAlert *alert) {
|
||||
[currentAlert addActionWithTitle:NSLocalizedStringFromTable(@"room_event_action_cancel_upload", @"Vector", nil) style:MXKAlertActionStyleDefault handler:^(MXKAlert *alert) {
|
||||
|
||||
__strong __typeof(weakSelf)strongSelf = weakSelf;
|
||||
[strongSelf cancelEventSelection];
|
||||
@@ -1274,7 +1281,7 @@
|
||||
NSString *cacheFilePath = roomBubbleTableViewCell.bubbleData.attachment.cacheFilePath;
|
||||
if ([MXKMediaManager existingDownloaderWithOutputFilePath:cacheFilePath])
|
||||
{
|
||||
[self.currentAlert addActionWithTitle:NSLocalizedStringFromTable(@"room_event_action_cancel_download", @"Vector", nil) style:MXKAlertActionStyleDefault handler:^(MXKAlert *alert) {
|
||||
[currentAlert addActionWithTitle:NSLocalizedStringFromTable(@"room_event_action_cancel_download", @"Vector", nil) style:MXKAlertActionStyleDefault handler:^(MXKAlert *alert) {
|
||||
|
||||
__strong __typeof(weakSelf)strongSelf = weakSelf;
|
||||
[strongSelf cancelEventSelection];
|
||||
@@ -1292,7 +1299,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
[self.currentAlert addActionWithTitle:NSLocalizedStringFromTable(@"room_event_action_redact", @"Vector", nil) style:MXKAlertActionStyleDefault handler:^(MXKAlert *alert) {
|
||||
[currentAlert addActionWithTitle:NSLocalizedStringFromTable(@"room_event_action_redact", @"Vector", nil) style:MXKAlertActionStyleDefault handler:^(MXKAlert *alert) {
|
||||
|
||||
__strong __typeof(weakSelf)strongSelf = weakSelf;
|
||||
[strongSelf cancelEventSelection];
|
||||
@@ -1316,25 +1323,110 @@
|
||||
}];
|
||||
}];
|
||||
|
||||
[self.currentAlert addActionWithTitle:NSLocalizedStringFromTable(@"room_event_action_permalink", @"Vector", nil) style:MXKAlertActionStyleDefault handler:^(MXKAlert *alert) {
|
||||
[currentAlert addActionWithTitle:NSLocalizedStringFromTable(@"room_event_action_permalink", @"Vector", nil) style:MXKAlertActionStyleDefault handler:^(MXKAlert *alert) {
|
||||
|
||||
__strong __typeof(weakSelf)strongSelf = weakSelf;
|
||||
[strongSelf cancelEventSelection];
|
||||
|
||||
// Create a permalink that is common to all Vector.im clients
|
||||
// FIXME: When available, use the prod Vector web app URL
|
||||
NSString *webAppUrl = [[NSUserDefaults standardUserDefaults] objectForKey:@"webAppUrlDev"];
|
||||
|
||||
NSString *permalink = [NSString stringWithFormat:@"%@/#/room/%@/%@",
|
||||
webAppUrl,
|
||||
[Tools webAppUrl],
|
||||
selectedEvent.roomId,
|
||||
selectedEvent.eventId];
|
||||
|
||||
[[UIPasteboard generalPasteboard] setString:permalink];
|
||||
}];
|
||||
|
||||
[currentAlert addActionWithTitle:NSLocalizedStringFromTable(@"room_event_action_report", @"Vector", nil) style:MXKAlertActionStyleDefault handler:^(MXKAlert *alert) {
|
||||
|
||||
__strong __typeof(weakSelf)strongSelf = weakSelf;
|
||||
[strongSelf cancelEventSelection];
|
||||
|
||||
// Prompt user to enter a description of the problem content.
|
||||
MXKAlert *reasonAlert = [[MXKAlert alloc] initWithTitle:NSLocalizedStringFromTable(@"room_event_action_report_prompt_reason", @"Vector", nil) message:nil style:MXKAlertStyleAlert];
|
||||
|
||||
[reasonAlert addTextFieldWithConfigurationHandler:^(UITextField *textField) {
|
||||
textField.secureTextEntry = NO;
|
||||
textField.placeholder = nil;
|
||||
textField.keyboardType = UIKeyboardTypeDefault;
|
||||
}];
|
||||
|
||||
[reasonAlert addActionWithTitle:[NSBundle mxk_localizedStringForKey:@"ok"] style:MXKAlertActionStyleDefault handler:^(MXKAlert *alert) {
|
||||
|
||||
UITextField *textField = [alert textFieldAtIndex:0];
|
||||
|
||||
__strong __typeof(weakSelf)strongSelf = weakSelf;
|
||||
strongSelf->currentAlert = nil;
|
||||
|
||||
[strongSelf startActivityIndicator];
|
||||
|
||||
[strongSelf.roomDataSource.room reportEvent:selectedEvent.eventId score:-100 reason:textField.text success:^{
|
||||
|
||||
__strong __typeof(weakSelf)strongSelf = weakSelf;
|
||||
[strongSelf stopActivityIndicator];
|
||||
|
||||
// Prompt user to ignore content from this user
|
||||
MXKAlert *ignoreAlert = [[MXKAlert alloc] initWithTitle:NSLocalizedStringFromTable(@"room_event_action_report_prompt_ignore_user", @"Vector", nil) message:nil style:MXKAlertStyleAlert];
|
||||
|
||||
[ignoreAlert addActionWithTitle:[NSBundle mxk_localizedStringForKey:@"yes"] style:MXKAlertActionStyleDefault handler:^(MXKAlert *alert) {
|
||||
|
||||
__strong __typeof(weakSelf)strongSelf = weakSelf;
|
||||
strongSelf->currentAlert = nil;
|
||||
|
||||
[strongSelf startActivityIndicator];
|
||||
|
||||
// Add the user to the blacklist: ignored users
|
||||
[strongSelf.mainSession ignoreUsers:@[selectedEvent.sender] success:^{
|
||||
|
||||
__strong __typeof(weakSelf)strongSelf = weakSelf;
|
||||
[strongSelf stopActivityIndicator];
|
||||
|
||||
} failure:^(NSError *error) {
|
||||
|
||||
__strong __typeof(weakSelf)strongSelf = weakSelf;
|
||||
[strongSelf stopActivityIndicator];
|
||||
|
||||
NSLog(@"[Vector RoomVC] Ignore user (%@) failed", selectedEvent.sender);
|
||||
//Alert user
|
||||
[[AppDelegate theDelegate] showErrorAsAlert:error];
|
||||
|
||||
}];
|
||||
|
||||
}];
|
||||
|
||||
ignoreAlert.cancelButtonIndex = [ignoreAlert addActionWithTitle:[NSBundle mxk_localizedStringForKey:@"no"] style:MXKAlertActionStyleDefault handler:^(MXKAlert *alert) {
|
||||
|
||||
__strong __typeof(weakSelf)strongSelf = weakSelf;
|
||||
strongSelf->currentAlert = nil;
|
||||
}];
|
||||
|
||||
strongSelf->currentAlert = ignoreAlert;
|
||||
[ignoreAlert showInViewController:strongSelf];
|
||||
|
||||
} failure:^(NSError *error) {
|
||||
|
||||
__strong __typeof(weakSelf)strongSelf = weakSelf;
|
||||
[strongSelf stopActivityIndicator];
|
||||
|
||||
NSLog(@"[Vector RoomVC] Report event (%@) failed", selectedEvent.eventId);
|
||||
//Alert user
|
||||
[[AppDelegate theDelegate] showErrorAsAlert:error];
|
||||
|
||||
}];
|
||||
}];
|
||||
|
||||
reasonAlert.cancelButtonIndex = [reasonAlert addActionWithTitle:[NSBundle mxk_localizedStringForKey:@"cancel"] style:MXKAlertActionStyleDefault handler:^(MXKAlert *alert) {
|
||||
|
||||
__strong __typeof(weakSelf)strongSelf = weakSelf;
|
||||
strongSelf->currentAlert = nil;
|
||||
}];
|
||||
|
||||
strongSelf->currentAlert = reasonAlert;
|
||||
[reasonAlert showInViewController:strongSelf];
|
||||
}];
|
||||
}
|
||||
|
||||
self.currentAlert.cancelButtonIndex = [self.currentAlert addActionWithTitle:NSLocalizedStringFromTable(@"cancel", @"Vector", nil) style:MXKAlertActionStyleDefault handler:^(MXKAlert *alert) {
|
||||
currentAlert.cancelButtonIndex = [currentAlert addActionWithTitle:NSLocalizedStringFromTable(@"cancel", @"Vector", nil) style:MXKAlertActionStyleDefault handler:^(MXKAlert *alert) {
|
||||
|
||||
__strong __typeof(weakSelf)strongSelf = weakSelf;
|
||||
[strongSelf cancelEventSelection];
|
||||
@@ -1342,14 +1434,14 @@
|
||||
}];
|
||||
|
||||
// Do not display empty action sheet
|
||||
if (self.currentAlert.cancelButtonIndex)
|
||||
if (currentAlert.cancelButtonIndex)
|
||||
{
|
||||
self.currentAlert.sourceView = roomBubbleTableViewCell;
|
||||
[self.currentAlert showInViewController:self];
|
||||
currentAlert.sourceView = roomBubbleTableViewCell;
|
||||
[currentAlert showInViewController:self];
|
||||
}
|
||||
else
|
||||
{
|
||||
self.currentAlert = nil;
|
||||
currentAlert = nil;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1392,10 +1484,10 @@
|
||||
|
||||
- (void)cancelEventSelection
|
||||
{
|
||||
if (self.currentAlert)
|
||||
if (currentAlert)
|
||||
{
|
||||
[self.currentAlert dismiss:NO];
|
||||
self.currentAlert = nil;
|
||||
[currentAlert dismiss:NO];
|
||||
currentAlert = nil;
|
||||
}
|
||||
|
||||
customizedRoomDataSource.selectedEventId = nil;
|
||||
@@ -1463,6 +1555,21 @@
|
||||
RoomSearchDataSource *roomSearchDataSource = [[RoomSearchDataSource alloc] initWithRoomDataSource:self.roomDataSource andMatrixSession:self.mainSession];
|
||||
[roomSearchViewController displaySearch:roomSearchDataSource];
|
||||
}
|
||||
else if ([[segue identifier] isEqualToString:@"showMemberDetails"])
|
||||
{
|
||||
if (selectedRoomMember)
|
||||
{
|
||||
RoomMemberDetailsViewController *memberViewController = pushedViewController;
|
||||
// Set rageShake handler
|
||||
memberViewController.rageShakeManager = [RageShakeManager sharedManager];
|
||||
// Set delegate to handle start chat option
|
||||
memberViewController.delegate = [AppDelegate theDelegate];
|
||||
|
||||
[memberViewController displayRoomMember:selectedRoomMember withMatrixRoom:self.roomDataSource.room];
|
||||
|
||||
selectedRoomMember = nil;
|
||||
}
|
||||
}
|
||||
|
||||
// Hide back button title
|
||||
self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStylePlain target:nil action:nil];
|
||||
@@ -1883,23 +1990,23 @@
|
||||
|
||||
} andIconTapGesture:^{
|
||||
|
||||
if (self.currentAlert)
|
||||
if (currentAlert)
|
||||
{
|
||||
[self.currentAlert dismiss:NO];
|
||||
[currentAlert dismiss:NO];
|
||||
}
|
||||
|
||||
__weak __typeof(self) weakSelf = self;
|
||||
self.currentAlert = [[MXKAlert alloc] initWithTitle:nil message:nil style:MXKAlertStyleActionSheet];
|
||||
currentAlert = [[MXKAlert alloc] initWithTitle:nil message:nil style:MXKAlertStyleActionSheet];
|
||||
|
||||
[self.currentAlert addActionWithTitle:NSLocalizedStringFromTable(@"room_resend_unsent_messages", @"Vector", nil) style:MXKAlertActionStyleDefault handler:^(MXKAlert *alert) {
|
||||
[currentAlert addActionWithTitle:NSLocalizedStringFromTable(@"room_resend_unsent_messages", @"Vector", nil) style:MXKAlertActionStyleDefault handler:^(MXKAlert *alert) {
|
||||
|
||||
__strong __typeof(weakSelf)strongSelf = weakSelf;
|
||||
[strongSelf resendAllUnsentMessages];
|
||||
strongSelf.currentAlert = nil;
|
||||
strongSelf->currentAlert = nil;
|
||||
|
||||
}];
|
||||
|
||||
[self.currentAlert addActionWithTitle:NSLocalizedStringFromTable(@"room_delete_unsent_messages", @"Vector", nil) style:MXKAlertActionStyleDefault handler:^(MXKAlert *alert) {
|
||||
[currentAlert addActionWithTitle:NSLocalizedStringFromTable(@"room_delete_unsent_messages", @"Vector", nil) style:MXKAlertActionStyleDefault handler:^(MXKAlert *alert) {
|
||||
|
||||
__strong __typeof(weakSelf)strongSelf = weakSelf;
|
||||
|
||||
@@ -1916,18 +2023,18 @@
|
||||
index ++;
|
||||
}
|
||||
}
|
||||
strongSelf.currentAlert = nil;
|
||||
strongSelf->currentAlert = nil;
|
||||
}];
|
||||
|
||||
self.currentAlert.cancelButtonIndex = [self.currentAlert addActionWithTitle:NSLocalizedStringFromTable(@"cancel", @"Vector", nil) style:MXKAlertActionStyleDefault handler:^(MXKAlert *alert) {
|
||||
currentAlert.cancelButtonIndex = [currentAlert addActionWithTitle:NSLocalizedStringFromTable(@"cancel", @"Vector", nil) style:MXKAlertActionStyleDefault handler:^(MXKAlert *alert) {
|
||||
|
||||
__strong __typeof(weakSelf)strongSelf = weakSelf;
|
||||
strongSelf.currentAlert = nil;
|
||||
strongSelf->currentAlert = nil;
|
||||
|
||||
}];
|
||||
|
||||
self.currentAlert.sourceView = roomActivitiesView;
|
||||
[self.currentAlert showInViewController:self];
|
||||
currentAlert.sourceView = roomActivitiesView;
|
||||
[currentAlert showInViewController:self];
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
@@ -710,9 +710,10 @@
|
||||
|
||||
enableAllCell.mxkLabel.text = NSLocalizedStringFromTable(@"settings_enable_push_notif", @"Vector", nil);
|
||||
enableAllCell.mxkSwitch.on = account.pushNotificationServiceIsActive;
|
||||
[enableAllCell.mxkSwitch removeTarget:self action:nil forControlEvents:UIControlEventTouchUpInside];
|
||||
[enableAllCell.mxkSwitch removeTarget:self action:nil forControlEvents:UIControlEventTouchUpInside];
|
||||
[enableAllCell.mxkSwitch addTarget:self action:@selector(togglePushNotifications:) forControlEvents:UIControlEventTouchUpInside];
|
||||
|
||||
[enableAllCell layoutIfNeeded];
|
||||
cell = enableAllCell;
|
||||
}
|
||||
else if (row == NOTIFICATION_SETTINGS_GLOBAL_SETTINGS_INDEX)
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#import "AuthInputsView.h"
|
||||
|
||||
#import "VectorDesignValues.h"
|
||||
#import "Tools.h"
|
||||
|
||||
@interface AuthInputsView ()
|
||||
{
|
||||
@@ -332,11 +333,8 @@
|
||||
submittedEmail = [[MXK3PID alloc] initWithMedium:kMX3PIDMediumEmail andAddress:self.emailTextField.text];
|
||||
|
||||
// Create the next link that is common to all Vector.im clients
|
||||
// FIXME: When available, use the prod Vector web app URL
|
||||
NSString *webAppUrl = [[NSUserDefaults standardUserDefaults] objectForKey:@"webAppUrlDev"];
|
||||
|
||||
NSString *nextLink = [NSString stringWithFormat:@"%@/#/register?client_secret=%@&hs_url=%@&is_url=%@&session_id=%@",
|
||||
webAppUrl,
|
||||
[Tools webAppUrl],
|
||||
[submittedEmail.clientSecret stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLHostAllowedCharacterSet]],
|
||||
[restClient.homeserver stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLHostAllowedCharacterSet]],
|
||||
[restClient.identityServer stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLHostAllowedCharacterSet]],
|
||||
|
||||
Reference in New Issue
Block a user