Skip to content

Commit

Permalink
Merge branch 'release/v0.11.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
manuroe committed Apr 24, 2020
2 parents bf15a78 + d951f4e commit 0145531
Show file tree
Hide file tree
Showing 155 changed files with 3,559 additions and 1,406 deletions.
17 changes: 17 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
Changes in 0.11.1 (2020-04-24)
===============================================

Improvements:
* Upgrade MatrixKit version ([v0.12.1](https://github.com/matrix-org/matrix-ios-kit/releases/tag/v0.12.1)).
* New icons.
* Cross-signing: Allow incoming device verification request from other user (#3139).
* Cross-signing: Allow to verify each device of users with no cross-signing (#3138).
* Jitsi: Make Jitsi widgets compatible with Matrix Widget API v2. This allows to use any Jitsi servers (#3150).

Bug fix:
* Settings: Security, present complete security when my device is not trusted (#3127).
* Settings: Security: Do not ask to complete security if there is no cross-signing (#3147).

Changes in 0.11.0 (2020-04-17)
===============================================

Expand All @@ -22,6 +36,9 @@ Improvements:
Bug fix:
* Key backup banner is not hidden correctly (#2899).

Bug fix:
* Considered safe area insets for some screens (PR #3084).

Changes in 0.10.5 (2020-04-01)
===============================================

Expand Down
2 changes: 1 addition & 1 deletion Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use_frameworks!

# Different flavours of pods to MatrixKit
# The current MatrixKit pod version
$matrixKitVersion = '0.12.0'
$matrixKitVersion = '0.12.1'

# The develop branch version
#$matrixKitVersion = 'develop'
Expand Down
34 changes: 17 additions & 17 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -50,38 +50,38 @@ PODS:
- MatomoTracker (7.2.0):
- MatomoTracker/Core (= 7.2.0)
- MatomoTracker/Core (7.2.0)
- MatrixKit (0.12.0):
- MatrixKit (0.12.1):
- cmark (~> 0.24.1)
- DTCoreText (~> 1.6.21)
- HPGrowingTextView (~> 1.1)
- libPhoneNumber-iOS (~> 0.9.13)
- MatrixKit/Core (= 0.12.0)
- MatrixSDK (= 0.16.0)
- MatrixKit/AppExtension (0.12.0):
- MatrixKit/Core (= 0.12.1)
- MatrixSDK (= 0.16.1)
- MatrixKit/AppExtension (0.12.1):
- cmark (~> 0.24.1)
- DTCoreText (~> 1.6.21)
- DTCoreText/Extension
- HPGrowingTextView (~> 1.1)
- libPhoneNumber-iOS (~> 0.9.13)
- MatrixSDK (= 0.16.0)
- MatrixKit/Core (0.12.0):
- MatrixSDK (= 0.16.1)
- MatrixKit/Core (0.12.1):
- cmark (~> 0.24.1)
- DTCoreText (~> 1.6.21)
- HPGrowingTextView (~> 1.1)
- libPhoneNumber-iOS (~> 0.9.13)
- MatrixSDK (= 0.16.0)
- MatrixSDK (0.16.0):
- MatrixSDK/Core (= 0.16.0)
- MatrixSDK/Core (0.16.0):
- MatrixSDK (= 0.16.1)
- MatrixSDK (0.16.1):
- MatrixSDK/Core (= 0.16.1)
- MatrixSDK/Core (0.16.1):
- AFNetworking (~> 3.2.0)
- GZIP (~> 1.2.2)
- libbase58 (~> 0.1.4)
- OLMKit (~> 3.1.0)
- Realm (~> 3.17.3)
- MatrixSDK/JingleCallStack (0.16.0):
- MatrixSDK/JingleCallStack (0.16.1):
- JitsiMeetSDK (~> 2.3.1)
- MatrixSDK/Core
- MatrixSDK/SwiftSupport (0.16.0):
- MatrixSDK/SwiftSupport (0.16.1):
- MatrixSDK/Core
- OLMKit (3.1.0):
- OLMKit/olmc (= 3.1.0)
Expand Down Expand Up @@ -109,8 +109,8 @@ DEPENDENCIES:
- GBDeviceInfo (~> 6.3.0)
- KTCenterFlowLayout (~> 1.3.1)
- MatomoTracker (~> 7.2.0)
- MatrixKit (= 0.12.0)
- MatrixKit/AppExtension (= 0.12.0)
- MatrixKit (= 0.12.1)
- MatrixKit/AppExtension (= 0.12.1)
- MatrixSDK/JingleCallStack
- MatrixSDK/SwiftSupport
- OLMKit
Expand Down Expand Up @@ -159,8 +159,8 @@ SPEC CHECKSUMS:
libbase58: 7c040313537b8c44b6e2d15586af8e21f7354efd
libPhoneNumber-iOS: 0a32a9525cf8744fe02c5206eb30d571e38f7d75
MatomoTracker: 6f89e2561083685a360e223fb663e9ccd57c1d1a
MatrixKit: 2ae83c621caf3c11681e00a0b802086ac4d1106c
MatrixSDK: caad3d93c665163d9d414f6876e9a7d220c6c46f
MatrixKit: 5ebf91a3fed5a9d4110d1db53b5da6889fa42dd0
MatrixSDK: 31c4b9d13335cf074aa3d6e90bb4b2a8c5bbb40a
OLMKit: 4ee0159d63feeb86d836fdcfefe418e163511639
Realm: 5a1d9d47bfc101dd597668b1a8af4288a2557f6d
Reusable: 82be188f29d96dc5eff0db7b2393bcc08d2cdd5b
Expand All @@ -169,6 +169,6 @@ SPEC CHECKSUMS:
zxcvbn-ios: fef98b7c80f1512ff0eec47ac1fa399fc00f7e3c
ZXingObjC: fdbb269f25dd2032da343e06f10224d62f537bdb

PODFILE CHECKSUM: 6f647ad2f6c765719fd7e9a5d1e9e77e797d328f
PODFILE CHECKSUM: 75ef978c4b52de673fe49d04b0f1c82d51f537a0

COCOAPODS: 1.9.1
60 changes: 60 additions & 0 deletions Riot.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions Riot/AppDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ extern NSString *const AppDelegateDidValidateEmailNotificationClientSecretKey;

- (BOOL)presentUserVerificationForRoomMember:(MXRoomMember*)roomMember session:(MXSession*)mxSession;

- (BOOL)presentCompleteSecurityForSession:(MXSession*)mxSession;

#pragma mark - Matrix Accounts handling

- (void)selectMatrixAccount:(void (^)(MXKAccount *selectedAccount))onSelection;
Expand Down
132 changes: 111 additions & 21 deletions Riot/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -4081,6 +4081,11 @@ - (void)presentJitsiViewController:(void (^)(void))completion

if (_jitsiViewController)
{
if (@available(iOS 13.0, *))
{
_jitsiViewController.modalPresentationStyle = UIModalPresentationFullScreen;
}

[self presentViewController:_jitsiViewController animated:YES completion:completion];
}
}
Expand Down Expand Up @@ -4232,11 +4237,26 @@ - (void)askNativeWidgetPermissionWithWidget:(Widget*)widget completion:(void (^)

#pragma mark - Call status handling

/// Returns a suitable height for call status bar. Considers safe area insets if available and notch status.
- (CGFloat)calculateCallStatusBarHeight
{
CGFloat result = CALL_STATUS_BAR_HEIGHT;
if (@available(iOS 11.0, *))
{
if (UIDevice.currentDevice.hasNotch)
{
// this device has a notch (iPhone X +)
result += UIApplication.sharedApplication.keyWindow.safeAreaInsets.top;
}
}
return result;
}

- (void)addCallStatusBar:(NSString*)buttonTitle
{
// Add a call status bar
CGSize topBarSize = CGSizeMake([[UIScreen mainScreen] bounds].size.width, CALL_STATUS_BAR_HEIGHT);
CGSize topBarSize = CGSizeMake([[UIScreen mainScreen] bounds].size.width, [self calculateCallStatusBarHeight]);

_callStatusBarWindow = [[UIWindow alloc] initWithFrame:CGRectMake(0, 0, topBarSize.width, topBarSize.height)];
_callStatusBarWindow.windowLevel = UIWindowLevelStatusBar;

Expand All @@ -4246,8 +4266,9 @@ - (void)addCallStatusBar:(NSString*)buttonTitle

[_callStatusBarButton setTitle:buttonTitle forState:UIControlStateNormal];
[_callStatusBarButton setTitle:buttonTitle forState:UIControlStateHighlighted];

_callStatusBarButton.titleLabel.textColor = ThemeService.shared.theme.backgroundColor;

_callStatusBarButton.titleLabel.font = [UIFont systemFontOfSize:17 weight:UIFontWeightMedium];

[_callStatusBarButton setBackgroundColor:ThemeService.shared.theme.tintColor];
Expand Down Expand Up @@ -4322,6 +4343,11 @@ - (void)presentCallViewController:(BOOL)animated completion:(void (^)(void))comp

if (currentCallViewController)
{
if (@available(iOS 13.0, *))
{
currentCallViewController.modalPresentationStyle = UIModalPresentationFullScreen;
}

[self presentViewController:currentCallViewController animated:animated completion:completion];
}
}
Expand All @@ -4333,36 +4359,52 @@ - (void)statusBarDidChangeFrame

// Refresh the root view controller frame
CGRect rootControllerFrame = [[UIScreen mainScreen] bounds];

if (_callStatusBarWindow)
{
CGFloat callStatusBarHeight = [self calculateCallStatusBarHeight];

UIInterfaceOrientation statusBarOrientation = [UIApplication sharedApplication].statusBarOrientation;

switch (statusBarOrientation)
{
case UIInterfaceOrientationLandscapeLeft:
{
_callStatusBarWindow.frame = CGRectMake(-rootControllerFrame.size.width / 2, -CALL_STATUS_BAR_HEIGHT / 2, rootControllerFrame.size.width, CALL_STATUS_BAR_HEIGHT);
_callStatusBarWindow.transform = CGAffineTransformMake(0, -1, 1, 0, CALL_STATUS_BAR_HEIGHT / 2, rootControllerFrame.size.width / 2);
_callStatusBarWindow.frame = CGRectMake(-rootControllerFrame.size.width / 2, -callStatusBarHeight / 2, rootControllerFrame.size.width, callStatusBarHeight);
_callStatusBarWindow.transform = CGAffineTransformMake(0, -1, 1, 0, callStatusBarHeight / 2, rootControllerFrame.size.width / 2);
break;
}
case UIInterfaceOrientationLandscapeRight:
{
_callStatusBarWindow.frame = CGRectMake(-rootControllerFrame.size.width / 2, -CALL_STATUS_BAR_HEIGHT / 2, rootControllerFrame.size.width, CALL_STATUS_BAR_HEIGHT);
_callStatusBarWindow.transform = CGAffineTransformMake(0, 1, -1, 0, rootControllerFrame.size.height - CALL_STATUS_BAR_HEIGHT / 2, rootControllerFrame.size.width / 2);
_callStatusBarWindow.frame = CGRectMake(-rootControllerFrame.size.width / 2, -callStatusBarHeight / 2, rootControllerFrame.size.width, callStatusBarHeight);
_callStatusBarWindow.transform = CGAffineTransformMake(0, 1, -1, 0, rootControllerFrame.size.height - callStatusBarHeight / 2, rootControllerFrame.size.width / 2);
break;
}
default:
{
_callStatusBarWindow.transform = CGAffineTransformIdentity;
_callStatusBarWindow.frame = CGRectMake(0, 0, rootControllerFrame.size.width, CALL_STATUS_BAR_HEIGHT);
_callStatusBarWindow.frame = CGRectMake(0, 0, rootControllerFrame.size.width, callStatusBarHeight);
break;
}
}

UIEdgeInsets callBarButtonContentEdgeInsets = UIEdgeInsetsZero;

if (@available(iOS 11.0, *))
{
callBarButtonContentEdgeInsets = UIApplication.sharedApplication.keyWindow.safeAreaInsets;
// should override top inset
callBarButtonContentEdgeInsets.top = callStatusBarHeight - CALL_STATUS_BAR_HEIGHT;
// should ignore bottom inset
callBarButtonContentEdgeInsets.bottom = 0.0;
// should keep left, and right insets as original
}

_callStatusBarButton.contentEdgeInsets = callBarButtonContentEdgeInsets;

// Apply the vertical offset due to call status bar
rootControllerFrame.origin.y = CALL_STATUS_BAR_HEIGHT;
rootControllerFrame.size.height -= CALL_STATUS_BAR_HEIGHT;
rootControllerFrame.origin.y = callStatusBarHeight;
rootControllerFrame.size.height -= callStatusBarHeight;
}

rootController.view.frame = rootControllerFrame;
Expand Down Expand Up @@ -4916,20 +4958,45 @@ - (void)keyVerificationNewRequestNotification:(NSNotification *)notification
{
MXKeyVerificationByToDeviceRequest *keyVerificationByToDeviceRequest = (MXKeyVerificationByToDeviceRequest*)keyVerificationRequest;

// We support only self verification
if (keyVerificationByToDeviceRequest.isFromMyUser
&& !keyVerificationByToDeviceRequest.isFromMyDevice
if (!keyVerificationByToDeviceRequest.isFromMyDevice
&& keyVerificationByToDeviceRequest.state == MXKeyVerificationRequestStatePending)
{
NSString *myUserId = keyVerificationByToDeviceRequest.otherUser;
MXKAccount *account = [[MXKAccountManager sharedManager] accountForUserId:myUserId];
if (account)
if (keyVerificationByToDeviceRequest.isFromMyUser)
{
MXSession *session = account.mxSession;
MXUser *user = [session userWithUserId:myUserId];

[self presentNewKeyVerificationRequestAlertForSession:session senderName:user.displayname senderId:user.userId request:keyVerificationRequest];
// Self verification
NSLog(@"[AppDelegate][KeyVerification] keyVerificationNewRequestNotification: Self verification from %@", keyVerificationByToDeviceRequest.otherDevice);

NSString *myUserId = keyVerificationByToDeviceRequest.otherUser;
MXKAccount *account = [[MXKAccountManager sharedManager] accountForUserId:myUserId];
if (account)
{
MXSession *session = account.mxSession;
MXUser *user = [session userWithUserId:myUserId];

[self presentNewKeyVerificationRequestAlertForSession:session senderName:user.displayname senderId:user.userId request:keyVerificationRequest];
}
}
else
{
// Device verification from other user
// This happens when they or our user do not have cross-signing enabled
NSLog(@"[AppDelegate][KeyVerification] keyVerificationNewRequestNotification: Device verification from other user %@:%@", keyVerificationByToDeviceRequest.otherUser, keyVerificationByToDeviceRequest.otherDevice);

NSString *myUserId = keyVerificationByToDeviceRequest.to;
NSString *userId = keyVerificationByToDeviceRequest.otherUser;
MXKAccount *account = [[MXKAccountManager sharedManager] accountForUserId:myUserId];
if (account)
{
MXSession *session = account.mxSession;
MXUser *user = [session userWithUserId:userId];

[self presentNewKeyVerificationRequestAlertForSession:session senderName:user.displayname senderId:user.userId request:keyVerificationRequest];
}
}
}
else
{
NSLog(@"[AppDelegate][KeyVerification] keyVerificationNewRequestNotification. Bad request state: %@", keyVerificationByToDeviceRequest);
}
}
}
Expand Down Expand Up @@ -5076,6 +5143,29 @@ - (void)presentNewSignInAlertForDevice:(MXDevice*)device inSession:(MXSession*)s
self.userNewSignInAlertController = alert;
}

#pragma mark - Complete security

- (BOOL)presentCompleteSecurityForSession:(MXSession*)mxSession
{
NSLog(@"[AppDelegate][MXKeyVerification] presentCompleteSecurityForSession");

BOOL presented = NO;
if (!keyVerificationCoordinatorBridgePresenter)
{
keyVerificationCoordinatorBridgePresenter = [[KeyVerificationCoordinatorBridgePresenter alloc] initWithSession:mxSession];
keyVerificationCoordinatorBridgePresenter.delegate = self;

[keyVerificationCoordinatorBridgePresenter presentCompleteSecurityFrom:self.presentedViewController isNewSignIn:NO animated:YES];

presented = YES;
}
else
{
NSLog(@"[AppDelegate][MXKeyVerification] presentCompleteSecurityForSession: Controller already presented.");
}
return presented;
}

#pragma mark - GDPR consent

// Observe user GDPR consent not given
Expand Down
Loading

0 comments on commit 0145531

Please sign in to comment.