Skip to content

Commit f6b85b8

Browse files
committed
Merge branch 'release/1.11.1/master'
2 parents 3997aad + 0ef02ef commit f6b85b8

File tree

12 files changed

+201
-31
lines changed

12 files changed

+201
-31
lines changed

CHANGES.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
## Changes in 1.11.1 (2023-08-29)
2+
3+
✨ Features
4+
5+
- New settings cell to manage your account through MAS if the home server allows it. ([#7653](https://github.com/vector-im/element-ios/issues/7653))
6+
7+
🙌 Improvements
8+
9+
- Upgrade MatrixSDK version ([v0.27.1](https://github.com/matrix-org/matrix-ios-sdk/releases/tag/v0.27.1)).
10+
11+
🐛 Bugfixes
12+
13+
- Prevent mention crashes when room members are missing display names (objc interop) ([#7649](https://github.com/vector-im/element-ios/pull/7649))
14+
- Add email UI is hidden if the 3 pid changes capability is disabled. ([#7645](https://github.com/vector-im/element-ios/issues/7645))
15+
- You can now log out from other sessions using MAS on supported OIDC home servers. ([#7646](https://github.com/vector-im/element-ios/issues/7646))
16+
- Deactivate account is hidden for servers with OIDC auth. ([#7648](https://github.com/vector-im/element-ios/issues/7648))
17+
- Prevent pill crashes when room members are missing display names (objc interop) ([#7651](https://github.com/vector-im/element-ios/issues/7651))
18+
19+
120
## Changes in 1.11.0 (2023-08-15)
221

322
✨ Features

Config/AppVersion.xcconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515
//
1616

1717
// Version
18-
MARKETING_VERSION = 1.11.0
19-
CURRENT_PROJECT_VERSION = 1.11.0
18+
MARKETING_VERSION = 1.11.1
19+
CURRENT_PROJECT_VERSION = 1.11.1

Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use_frameworks!
1616
# - `{ :specHash => {sdk spec hash}` to depend on specific pod options (:git => …, :podspec => …) for MatrixSDK repo. Used by Fastfile during CI
1717
#
1818
# Warning: our internal tooling depends on the name of this variable name, so be sure not to change it
19-
$matrixSDKVersion = '= 0.27.0'
19+
$matrixSDKVersion = '= 0.27.1'
2020
# $matrixSDKVersion = :local
2121
# $matrixSDKVersion = { :branch => 'develop'}
2222
# $matrixSDKVersion = { :specHash => { git: 'https://git.io/fork123', branch: 'fix' } }

Podfile.lock

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ PODS:
2626
- GBDeviceInfo/Core (= 7.1.0)
2727
- GBDeviceInfo/Core (7.1.0)
2828
- GZIP (1.3.0)
29-
- Introspect (0.1.4)
29+
- Introspect (0.11.0)
3030
- JitsiMeetSDKLite (8.1.2-lite):
3131
- JitsiWebRTC (~> 111.0)
3232
- JitsiWebRTC (111.0.2)
@@ -39,17 +39,17 @@ PODS:
3939
- LoggerAPI (1.9.200):
4040
- Logging (~> 1.1)
4141
- Logging (1.4.0)
42-
- MatrixSDK (0.27.0):
43-
- MatrixSDK/Core (= 0.27.0)
44-
- MatrixSDK/Core (0.27.0):
42+
- MatrixSDK (0.27.1):
43+
- MatrixSDK/Core (= 0.27.1)
44+
- MatrixSDK/Core (0.27.1):
4545
- AFNetworking (~> 4.0.0)
4646
- GZIP (~> 1.3.0)
4747
- libbase58 (~> 0.1.4)
4848
- MatrixSDKCrypto (= 0.3.12)
4949
- OLMKit (~> 3.2.5)
5050
- Realm (= 10.27.0)
5151
- SwiftyBeaver (= 1.9.5)
52-
- MatrixSDK/JingleCallStack (0.27.0):
52+
- MatrixSDK/JingleCallStack (0.27.1):
5353
- JitsiMeetSDKLite (= 8.1.2-lite)
5454
- MatrixSDK/Core
5555
- MatrixSDKCrypto (0.3.12)
@@ -102,8 +102,8 @@ DEPENDENCIES:
102102
- KeychainAccess (~> 4.2.2)
103103
- KTCenterFlowLayout (~> 1.3.1)
104104
- libPhoneNumber-iOS (~> 0.9.13)
105-
- MatrixSDK (= 0.27.0)
106-
- MatrixSDK/JingleCallStack (= 0.27.0)
105+
- MatrixSDK (= 0.27.1)
106+
- MatrixSDK/JingleCallStack (= 0.27.1)
107107
- OLMKit
108108
- PostHog (~> 2.0.0)
109109
- ReadMoreTextView (~> 3.0.1)
@@ -177,7 +177,7 @@ SPEC CHECKSUMS:
177177
FlowCommoniOS: ca92071ab526dc89905495a37844fd7e78d1a7f2
178178
GBDeviceInfo: 5d62fa85bdcce3ed288d83c28789adf1173e4376
179179
GZIP: 416858efbe66b41b206895ac6dfd5493200d95b3
180-
Introspect: b62c4dd2063072327c21d618ef2bedc3c87bc366
180+
Introspect: 4cc1e4c34dd016540c8d86a591c231c09dafbee3
181181
JitsiMeetSDKLite: 895213158cf62342069a10634a41d2f1c00057f7
182182
JitsiWebRTC: 80f62908fcf2a1160e0d14b584323fb6e6be630b
183183
KeychainAccess: c0c4f7f38f6fc7bbe58f5702e25f7bd2f65abf51
@@ -187,7 +187,7 @@ SPEC CHECKSUMS:
187187
libPhoneNumber-iOS: 0a32a9525cf8744fe02c5206eb30d571e38f7d75
188188
LoggerAPI: ad9c4a6f1e32f518fdb43a1347ac14d765ab5e3d
189189
Logging: beeb016c9c80cf77042d62e83495816847ef108b
190-
MatrixSDK: 981c0e6abd40f0882e1316923edb2b3966d29513
190+
MatrixSDK: f6c197ca06aab29ff69d1105965a57d277dfcd9d
191191
MatrixSDKCrypto: 25929a40733b4ab54f659aaf6a730552a0a06504
192192
OLMKit: da115f16582e47626616874e20f7bb92222c7a51
193193
PostHog: 660ec6c9d80cec17b685e148f17f6785a88b597d
@@ -208,6 +208,6 @@ SPEC CHECKSUMS:
208208
zxcvbn-ios: fef98b7c80f1512ff0eec47ac1fa399fc00f7e3c
209209
ZXingObjC: fdbb269f25dd2032da343e06f10224d62f537bdb
210210

211-
PODFILE CHECKSUM: f8f66ce4fa24937192a493d3a0a5c2c2e429c8fc
211+
PODFILE CHECKSUM: ce6afe3dea7ea9b073a7ad0406b2cc5615646746
212212

213213
COCOAPODS: 1.11.3

Riot/Assets/en.lproj/Vector.strings

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,9 @@ Tap the + to start adding people.";
748748
"settings_three_pids_management_information_part1" = "Manage which email addresses or phone numbers you can use to log in or recover your account here. Control who can find you in ";
749749
"settings_three_pids_management_information_part2" = "Discovery";
750750
"settings_three_pids_management_information_part3" = ".";
751+
"settings_manage_account_title" = "Account";
752+
"settings_manage_account_action" = "Manage account";
753+
"settings_manage_account_description" = "Manage your account at %@";
751754

752755
"settings_confirm_media_size" = "Confirm size when sending";
753756
"settings_confirm_media_size_description" = "When this is on, you’ll be asked to confirm what size images and videos will be sent as.";
@@ -964,6 +967,8 @@ Tap the + to start adding people.";
964967
"manage_session_trusted" = "Trusted by you";
965968
"manage_session_not_trusted" = "Not trusted";
966969
"manage_session_sign_out" = "Sign out of this session";
970+
"manage_session_redirect" = "You will be redirected to your server's authentication provider to complete sign out.";
971+
"manage_session_redirect_error" = "Functionality currently unavailable. Please contact your homeserver admin";
967972
"manage_session_rename" = "Rename session";
968973
"manage_session_sign_out_other_sessions" = "Sign out of all other sessions";
969974
// User sessions management

Riot/Generated/Strings.swift

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3667,6 +3667,14 @@ public class VectorL10n: NSObject {
36673667
public static var manageSessionNotTrusted: String {
36683668
return VectorL10n.tr("Vector", "manage_session_not_trusted")
36693669
}
3670+
/// You will be redirected to your server's authentication provider to complete sign out.
3671+
public static var manageSessionRedirect: String {
3672+
return VectorL10n.tr("Vector", "manage_session_redirect")
3673+
}
3674+
/// Functionality currently unavailable. Please contact your homeserver admin
3675+
public static var manageSessionRedirectError: String {
3676+
return VectorL10n.tr("Vector", "manage_session_redirect_error")
3677+
}
36703678
/// Rename session
36713679
public static var manageSessionRename: String {
36723680
return VectorL10n.tr("Vector", "manage_session_rename")
@@ -7791,6 +7799,18 @@ public class VectorL10n: NSObject {
77917799
public static var settingsLinks: String {
77927800
return VectorL10n.tr("Vector", "settings_links")
77937801
}
7802+
/// Manage account
7803+
public static var settingsManageAccountAction: String {
7804+
return VectorL10n.tr("Vector", "settings_manage_account_action")
7805+
}
7806+
/// Manage your account at %@
7807+
public static func settingsManageAccountDescription(_ p1: String) -> String {
7808+
return VectorL10n.tr("Vector", "settings_manage_account_description", p1)
7809+
}
7810+
/// Account
7811+
public static var settingsManageAccountTitle: String {
7812+
return VectorL10n.tr("Vector", "settings_manage_account_title")
7813+
}
77947814
/// Mark all messages as read
77957815
public static var settingsMarkAllAsRead: String {
77967816
return VectorL10n.tr("Vector", "settings_mark_all_as_read")

Riot/Modules/Pills/PillsFormatter.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,12 +197,14 @@ class PillsFormatter: NSObject {
197197
guard let roomMember = roomState.members.member(withUserId: userId) else {
198198
return
199199
}
200+
201+
let displayName = roomMember.displayname ?? userId
200202

201203
pill.data?.items = [
202204
.avatar(url: roomMember.avatarUrl,
203-
string: roomMember.displayname,
204-
matrixId: roomMember.userId),
205-
.text(roomMember.displayname)
205+
string: displayName,
206+
matrixId: userId),
207+
.text(displayName)
206208
]
207209
default:
208210
break

Riot/Modules/Room/Views/WYSIWYGInputToolbar/WysiwygInputToolbarView.swift

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,14 @@ class WysiwygInputToolbarView: MXKRoomInputToolbarView, NibLoadable, HtmlRoomInp
207207
}
208208

209209
func mention(_ member: MXRoomMember) {
210-
self.wysiwygViewModel.setMention(url: MXTools.permalinkToUser(withUserId: member.userId),
211-
name: member.displayname,
210+
guard let userId = member.userId else {
211+
return
212+
}
213+
214+
let displayName = member.displayname ?? userId
215+
216+
self.wysiwygViewModel.setMention(url: MXTools.permalinkToUser(withUserId: userId),
217+
name: displayName,
212218
mentionType: .user)
213219
}
214220

Riot/Modules/Settings/Security/ManageSession/ManageSessionViewController.m

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,52 @@ - (void)showTrustForDevice:(MXDevice *)device
655655
}
656656

657657
- (void)removeDevice
658+
{
659+
MXWellKnownAuthentication *authentication = self.mainSession.homeserverWellknown.authentication;
660+
if (authentication)
661+
{
662+
NSURL *logoutURL = [authentication getLogoutDeviceURLFromID:device.deviceId];
663+
if (logoutURL)
664+
{
665+
[self removeDeviceRedirectWithURL:logoutURL];
666+
}
667+
else
668+
{
669+
[self showRemoveDeviceRedirectError];
670+
}
671+
}
672+
else
673+
{
674+
[self removeDeviceThroughAPI];
675+
}
676+
}
677+
678+
-(void) removeDeviceRedirectWithURL: (NSURL * _Nonnull) url
679+
{
680+
UIAlertController *alert = [UIAlertController alertControllerWithTitle: [VectorL10n manageSessionRedirect] message: nil preferredStyle:UIAlertControllerStyleAlert];
681+
682+
__weak typeof(self) weakSelf = self;
683+
UIAlertAction *action = [UIAlertAction actionWithTitle:[VectorL10n ok]
684+
style:UIAlertActionStyleDefault
685+
handler: ^(UIAlertAction * action) {
686+
[UIApplication.sharedApplication openURL:url options:@{} completionHandler:^(BOOL success) {
687+
if (success && weakSelf)
688+
{
689+
[weakSelf withdrawViewControllerAnimated:YES completion:nil];
690+
}
691+
}];
692+
}];
693+
[alert addAction: action];
694+
[self presentViewController:alert animated:YES completion:nil];
695+
}
696+
697+
-(void) showRemoveDeviceRedirectError
698+
{
699+
UIAlertController *alert = [UIAlertController alertControllerWithTitle: [VectorL10n manageSessionRedirectError] message: nil preferredStyle:UIAlertControllerStyleAlert];
700+
[self presentViewController:alert animated:YES completion:nil];
701+
}
702+
703+
-(void) removeDeviceThroughAPI
658704
{
659705
[self startActivityIndicator];
660706
self.view.userInteractionEnabled = NO;

Riot/Modules/Settings/SettingsViewController.m

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ typedef NS_ENUM(NSUInteger, SECTION_TAG)
5050
{
5151
SECTION_TAG_SIGN_OUT = 0,
5252
SECTION_TAG_USER_SETTINGS,
53+
SECTION_TAG_ACCOUNT,
5354
SECTION_TAG_SENDING_MEDIA,
5455
SECTION_TAG_LINKS,
5556
SECTION_TAG_SECURITY,
@@ -185,6 +186,11 @@ typedef NS_ENUM(NSUInteger, SECURITY)
185186
DEVICE_MANAGER_INDEX
186187
};
187188

189+
typedef NS_ENUM(NSUInteger, ACCOUNT)
190+
{
191+
ACCOUNT_MANAGE_INDEX = 0,
192+
};
193+
188194
typedef void (^blockSettingsViewController_onReadyToDestroy)(void);
189195

190196
#pragma mark - SettingsViewController
@@ -365,7 +371,10 @@ - (void)updateSections
365371
{
366372
[sectionUserSettings addRowWithTag: USER_SETTINGS_PHONENUMBERS_OFFSET + index];
367373
}
368-
if (BuildSettings.settingsScreenAllowAddingEmailThreepids)
374+
if (BuildSettings.settingsScreenAllowAddingEmailThreepids &&
375+
// If the threePidChanges is nil we assume the capability to be true
376+
(!self.mainSession.homeserverCapabilities.threePidChanges ||
377+
self.mainSession.homeserverCapabilities.threePidChanges.enabled))
369378
{
370379
[sectionUserSettings addRowWithTag:USER_SETTINGS_ADD_EMAIL_INDEX];
371380
}
@@ -383,6 +392,16 @@ - (void)updateSections
383392

384393
sectionUserSettings.headerTitle = [VectorL10n settingsUserSettings];
385394
[tmpSections addObject:sectionUserSettings];
395+
396+
NSString *manageAccountURL = self.mainSession.homeserverWellknown.authentication.account;
397+
if (manageAccountURL)
398+
{
399+
Section *account = [Section sectionWithTag: SECTION_TAG_ACCOUNT];
400+
[account addRowWithTag:ACCOUNT_MANAGE_INDEX];
401+
account.headerTitle = [VectorL10n settingsManageAccountTitle];
402+
account.footerTitle = [VectorL10n settingsManageAccountDescription:manageAccountURL];
403+
[tmpSections addObject:account];
404+
}
386405

387406
if (BuildSettings.settingsScreenShowConfirmMediaSize)
388407
{
@@ -608,7 +627,7 @@ - (void)updateSections
608627
}
609628
}
610629

611-
if (BuildSettings.settingsScreenAllowDeactivatingAccount)
630+
if (BuildSettings.settingsScreenAllowDeactivatingAccount && !self.mainSession.homeserverWellknown.authentication)
612631
{
613632
Section *sectionDeactivate = [Section sectionWithTag:SECTION_TAG_DEACTIVATE_ACCOUNT];
614633
[sectionDeactivate addRowWithTag:0];
@@ -2626,6 +2645,17 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
26262645

26272646
cell = deactivateAccountBtnCell;
26282647
}
2648+
else if (section == SECTION_TAG_ACCOUNT)
2649+
{
2650+
switch (row)
2651+
{
2652+
case ACCOUNT_MANAGE_INDEX:
2653+
cell = [self getDefaultTableViewCell:tableView];
2654+
cell.textLabel.text = [VectorL10n settingsManageAccountAction];
2655+
[cell vc_setAccessoryDisclosureIndicatorWithCurrentTheme];
2656+
break;
2657+
}
2658+
}
26292659

26302660
return cell;
26312661
}
@@ -2975,6 +3005,14 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
29753005
break;
29763006
}
29773007
}
3008+
else if (section == SECTION_TAG_ACCOUNT)
3009+
{
3010+
switch(row) {
3011+
case ACCOUNT_MANAGE_INDEX:
3012+
[self onManageAccountTap];
3013+
break;
3014+
}
3015+
}
29783016

29793017
[tableView deselectRowAtIndexPath:indexPath animated:YES];
29803018
}
@@ -3883,6 +3921,14 @@ - (void)onProfileAvatarTap:(UITapGestureRecognizer *)recognizer
38833921
}
38843922
}
38853923

3924+
- (void)onManageAccountTap
3925+
{
3926+
NSURL *url = [NSURL URLWithString: self.mainSession.homeserverWellknown.authentication.account];
3927+
if (url) {
3928+
[UIApplication.sharedApplication openURL:url options:@{} completionHandler:nil];
3929+
}
3930+
}
3931+
38863932
- (void)showThemePicker
38873933
{
38883934
__weak typeof(self) weakSelf = self;

0 commit comments

Comments
 (0)