Skip to content

Commit

Permalink
Merge branch 'release/1.11.1/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanceriu committed Aug 29, 2023
2 parents 3997aad + 0ef02ef commit f6b85b8
Show file tree
Hide file tree
Showing 12 changed files with 201 additions and 31 deletions.
19 changes: 19 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
## Changes in 1.11.1 (2023-08-29)

✨ Features

- 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))

🙌 Improvements

- Upgrade MatrixSDK version ([v0.27.1](https://github.com/matrix-org/matrix-ios-sdk/releases/tag/v0.27.1)).

🐛 Bugfixes

- Prevent mention crashes when room members are missing display names (objc interop) ([#7649](https://github.com/vector-im/element-ios/pull/7649))
- Add email UI is hidden if the 3 pid changes capability is disabled. ([#7645](https://github.com/vector-im/element-ios/issues/7645))
- 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))
- Deactivate account is hidden for servers with OIDC auth. ([#7648](https://github.com/vector-im/element-ios/issues/7648))
- Prevent pill crashes when room members are missing display names (objc interop) ([#7651](https://github.com/vector-im/element-ios/issues/7651))


## Changes in 1.11.0 (2023-08-15)

✨ Features
Expand Down
4 changes: 2 additions & 2 deletions Config/AppVersion.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
//

// Version
MARKETING_VERSION = 1.11.0
CURRENT_PROJECT_VERSION = 1.11.0
MARKETING_VERSION = 1.11.1
CURRENT_PROJECT_VERSION = 1.11.1
2 changes: 1 addition & 1 deletion Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use_frameworks!
# - `{ :specHash => {sdk spec hash}` to depend on specific pod options (:git => …, :podspec => …) for MatrixSDK repo. Used by Fastfile during CI
#
# Warning: our internal tooling depends on the name of this variable name, so be sure not to change it
$matrixSDKVersion = '= 0.27.0'
$matrixSDKVersion = '= 0.27.1'
# $matrixSDKVersion = :local
# $matrixSDKVersion = { :branch => 'develop'}
# $matrixSDKVersion = { :specHash => { git: 'https://git.io/fork123', branch: 'fix' } }
Expand Down
20 changes: 10 additions & 10 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ PODS:
- GBDeviceInfo/Core (= 7.1.0)
- GBDeviceInfo/Core (7.1.0)
- GZIP (1.3.0)
- Introspect (0.1.4)
- Introspect (0.11.0)
- JitsiMeetSDKLite (8.1.2-lite):
- JitsiWebRTC (~> 111.0)
- JitsiWebRTC (111.0.2)
Expand All @@ -39,17 +39,17 @@ PODS:
- LoggerAPI (1.9.200):
- Logging (~> 1.1)
- Logging (1.4.0)
- MatrixSDK (0.27.0):
- MatrixSDK/Core (= 0.27.0)
- MatrixSDK/Core (0.27.0):
- MatrixSDK (0.27.1):
- MatrixSDK/Core (= 0.27.1)
- MatrixSDK/Core (0.27.1):
- AFNetworking (~> 4.0.0)
- GZIP (~> 1.3.0)
- libbase58 (~> 0.1.4)
- MatrixSDKCrypto (= 0.3.12)
- OLMKit (~> 3.2.5)
- Realm (= 10.27.0)
- SwiftyBeaver (= 1.9.5)
- MatrixSDK/JingleCallStack (0.27.0):
- MatrixSDK/JingleCallStack (0.27.1):
- JitsiMeetSDKLite (= 8.1.2-lite)
- MatrixSDK/Core
- MatrixSDKCrypto (0.3.12)
Expand Down Expand Up @@ -102,8 +102,8 @@ DEPENDENCIES:
- KeychainAccess (~> 4.2.2)
- KTCenterFlowLayout (~> 1.3.1)
- libPhoneNumber-iOS (~> 0.9.13)
- MatrixSDK (= 0.27.0)
- MatrixSDK/JingleCallStack (= 0.27.0)
- MatrixSDK (= 0.27.1)
- MatrixSDK/JingleCallStack (= 0.27.1)
- OLMKit
- PostHog (~> 2.0.0)
- ReadMoreTextView (~> 3.0.1)
Expand Down Expand Up @@ -177,7 +177,7 @@ SPEC CHECKSUMS:
FlowCommoniOS: ca92071ab526dc89905495a37844fd7e78d1a7f2
GBDeviceInfo: 5d62fa85bdcce3ed288d83c28789adf1173e4376
GZIP: 416858efbe66b41b206895ac6dfd5493200d95b3
Introspect: b62c4dd2063072327c21d618ef2bedc3c87bc366
Introspect: 4cc1e4c34dd016540c8d86a591c231c09dafbee3
JitsiMeetSDKLite: 895213158cf62342069a10634a41d2f1c00057f7
JitsiWebRTC: 80f62908fcf2a1160e0d14b584323fb6e6be630b
KeychainAccess: c0c4f7f38f6fc7bbe58f5702e25f7bd2f65abf51
Expand All @@ -187,7 +187,7 @@ SPEC CHECKSUMS:
libPhoneNumber-iOS: 0a32a9525cf8744fe02c5206eb30d571e38f7d75
LoggerAPI: ad9c4a6f1e32f518fdb43a1347ac14d765ab5e3d
Logging: beeb016c9c80cf77042d62e83495816847ef108b
MatrixSDK: 981c0e6abd40f0882e1316923edb2b3966d29513
MatrixSDK: f6c197ca06aab29ff69d1105965a57d277dfcd9d
MatrixSDKCrypto: 25929a40733b4ab54f659aaf6a730552a0a06504
OLMKit: da115f16582e47626616874e20f7bb92222c7a51
PostHog: 660ec6c9d80cec17b685e148f17f6785a88b597d
Expand All @@ -208,6 +208,6 @@ SPEC CHECKSUMS:
zxcvbn-ios: fef98b7c80f1512ff0eec47ac1fa399fc00f7e3c
ZXingObjC: fdbb269f25dd2032da343e06f10224d62f537bdb

PODFILE CHECKSUM: f8f66ce4fa24937192a493d3a0a5c2c2e429c8fc
PODFILE CHECKSUM: ce6afe3dea7ea9b073a7ad0406b2cc5615646746

COCOAPODS: 1.11.3
5 changes: 5 additions & 0 deletions Riot/Assets/en.lproj/Vector.strings
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,9 @@ Tap the + to start adding people.";
"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 ";
"settings_three_pids_management_information_part2" = "Discovery";
"settings_three_pids_management_information_part3" = ".";
"settings_manage_account_title" = "Account";
"settings_manage_account_action" = "Manage account";
"settings_manage_account_description" = "Manage your account at %@";

"settings_confirm_media_size" = "Confirm size when sending";
"settings_confirm_media_size_description" = "When this is on, you’ll be asked to confirm what size images and videos will be sent as.";
Expand Down Expand Up @@ -964,6 +967,8 @@ Tap the + to start adding people.";
"manage_session_trusted" = "Trusted by you";
"manage_session_not_trusted" = "Not trusted";
"manage_session_sign_out" = "Sign out of this session";
"manage_session_redirect" = "You will be redirected to your server's authentication provider to complete sign out.";
"manage_session_redirect_error" = "Functionality currently unavailable. Please contact your homeserver admin";
"manage_session_rename" = "Rename session";
"manage_session_sign_out_other_sessions" = "Sign out of all other sessions";
// User sessions management
Expand Down
20 changes: 20 additions & 0 deletions Riot/Generated/Strings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3667,6 +3667,14 @@ public class VectorL10n: NSObject {
public static var manageSessionNotTrusted: String {
return VectorL10n.tr("Vector", "manage_session_not_trusted")
}
/// You will be redirected to your server's authentication provider to complete sign out.
public static var manageSessionRedirect: String {
return VectorL10n.tr("Vector", "manage_session_redirect")
}
/// Functionality currently unavailable. Please contact your homeserver admin
public static var manageSessionRedirectError: String {
return VectorL10n.tr("Vector", "manage_session_redirect_error")
}
/// Rename session
public static var manageSessionRename: String {
return VectorL10n.tr("Vector", "manage_session_rename")
Expand Down Expand Up @@ -7791,6 +7799,18 @@ public class VectorL10n: NSObject {
public static var settingsLinks: String {
return VectorL10n.tr("Vector", "settings_links")
}
/// Manage account
public static var settingsManageAccountAction: String {
return VectorL10n.tr("Vector", "settings_manage_account_action")
}
/// Manage your account at %@
public static func settingsManageAccountDescription(_ p1: String) -> String {
return VectorL10n.tr("Vector", "settings_manage_account_description", p1)
}
/// Account
public static var settingsManageAccountTitle: String {
return VectorL10n.tr("Vector", "settings_manage_account_title")
}
/// Mark all messages as read
public static var settingsMarkAllAsRead: String {
return VectorL10n.tr("Vector", "settings_mark_all_as_read")
Expand Down
8 changes: 5 additions & 3 deletions Riot/Modules/Pills/PillsFormatter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,14 @@ class PillsFormatter: NSObject {
guard let roomMember = roomState.members.member(withUserId: userId) else {
return
}

let displayName = roomMember.displayname ?? userId

pill.data?.items = [
.avatar(url: roomMember.avatarUrl,
string: roomMember.displayname,
matrixId: roomMember.userId),
.text(roomMember.displayname)
string: displayName,
matrixId: userId),
.text(displayName)
]
default:
break
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,14 @@ class WysiwygInputToolbarView: MXKRoomInputToolbarView, NibLoadable, HtmlRoomInp
}

func mention(_ member: MXRoomMember) {
self.wysiwygViewModel.setMention(url: MXTools.permalinkToUser(withUserId: member.userId),
name: member.displayname,
guard let userId = member.userId else {
return
}

let displayName = member.displayname ?? userId

self.wysiwygViewModel.setMention(url: MXTools.permalinkToUser(withUserId: userId),
name: displayName,
mentionType: .user)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,52 @@ - (void)showTrustForDevice:(MXDevice *)device
}

- (void)removeDevice
{
MXWellKnownAuthentication *authentication = self.mainSession.homeserverWellknown.authentication;
if (authentication)
{
NSURL *logoutURL = [authentication getLogoutDeviceURLFromID:device.deviceId];
if (logoutURL)
{
[self removeDeviceRedirectWithURL:logoutURL];
}
else
{
[self showRemoveDeviceRedirectError];
}
}
else
{
[self removeDeviceThroughAPI];
}
}

-(void) removeDeviceRedirectWithURL: (NSURL * _Nonnull) url
{
UIAlertController *alert = [UIAlertController alertControllerWithTitle: [VectorL10n manageSessionRedirect] message: nil preferredStyle:UIAlertControllerStyleAlert];

__weak typeof(self) weakSelf = self;
UIAlertAction *action = [UIAlertAction actionWithTitle:[VectorL10n ok]
style:UIAlertActionStyleDefault
handler: ^(UIAlertAction * action) {
[UIApplication.sharedApplication openURL:url options:@{} completionHandler:^(BOOL success) {
if (success && weakSelf)
{
[weakSelf withdrawViewControllerAnimated:YES completion:nil];
}
}];
}];
[alert addAction: action];
[self presentViewController:alert animated:YES completion:nil];
}

-(void) showRemoveDeviceRedirectError
{
UIAlertController *alert = [UIAlertController alertControllerWithTitle: [VectorL10n manageSessionRedirectError] message: nil preferredStyle:UIAlertControllerStyleAlert];
[self presentViewController:alert animated:YES completion:nil];
}

-(void) removeDeviceThroughAPI
{
[self startActivityIndicator];
self.view.userInteractionEnabled = NO;
Expand Down
50 changes: 48 additions & 2 deletions Riot/Modules/Settings/SettingsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ typedef NS_ENUM(NSUInteger, SECTION_TAG)
{
SECTION_TAG_SIGN_OUT = 0,
SECTION_TAG_USER_SETTINGS,
SECTION_TAG_ACCOUNT,
SECTION_TAG_SENDING_MEDIA,
SECTION_TAG_LINKS,
SECTION_TAG_SECURITY,
Expand Down Expand Up @@ -185,6 +186,11 @@ typedef NS_ENUM(NSUInteger, SECURITY)
DEVICE_MANAGER_INDEX
};

typedef NS_ENUM(NSUInteger, ACCOUNT)
{
ACCOUNT_MANAGE_INDEX = 0,
};

typedef void (^blockSettingsViewController_onReadyToDestroy)(void);

#pragma mark - SettingsViewController
Expand Down Expand Up @@ -365,7 +371,10 @@ - (void)updateSections
{
[sectionUserSettings addRowWithTag: USER_SETTINGS_PHONENUMBERS_OFFSET + index];
}
if (BuildSettings.settingsScreenAllowAddingEmailThreepids)
if (BuildSettings.settingsScreenAllowAddingEmailThreepids &&
// If the threePidChanges is nil we assume the capability to be true
(!self.mainSession.homeserverCapabilities.threePidChanges ||
self.mainSession.homeserverCapabilities.threePidChanges.enabled))
{
[sectionUserSettings addRowWithTag:USER_SETTINGS_ADD_EMAIL_INDEX];
}
Expand All @@ -383,6 +392,16 @@ - (void)updateSections

sectionUserSettings.headerTitle = [VectorL10n settingsUserSettings];
[tmpSections addObject:sectionUserSettings];

NSString *manageAccountURL = self.mainSession.homeserverWellknown.authentication.account;
if (manageAccountURL)
{
Section *account = [Section sectionWithTag: SECTION_TAG_ACCOUNT];
[account addRowWithTag:ACCOUNT_MANAGE_INDEX];
account.headerTitle = [VectorL10n settingsManageAccountTitle];
account.footerTitle = [VectorL10n settingsManageAccountDescription:manageAccountURL];
[tmpSections addObject:account];
}

if (BuildSettings.settingsScreenShowConfirmMediaSize)
{
Expand Down Expand Up @@ -608,7 +627,7 @@ - (void)updateSections
}
}

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

cell = deactivateAccountBtnCell;
}
else if (section == SECTION_TAG_ACCOUNT)
{
switch (row)
{
case ACCOUNT_MANAGE_INDEX:
cell = [self getDefaultTableViewCell:tableView];
cell.textLabel.text = [VectorL10n settingsManageAccountAction];
[cell vc_setAccessoryDisclosureIndicatorWithCurrentTheme];
break;
}
}

return cell;
}
Expand Down Expand Up @@ -2975,6 +3005,14 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
break;
}
}
else if (section == SECTION_TAG_ACCOUNT)
{
switch(row) {
case ACCOUNT_MANAGE_INDEX:
[self onManageAccountTap];
break;
}
}

[tableView deselectRowAtIndexPath:indexPath animated:YES];
}
Expand Down Expand Up @@ -3883,6 +3921,14 @@ - (void)onProfileAvatarTap:(UITapGestureRecognizer *)recognizer
}
}

- (void)onManageAccountTap
{
NSURL *url = [NSURL URLWithString: self.mainSession.homeserverWellknown.authentication.account];
if (url) {
[UIApplication.sharedApplication openURL:url options:@{} completionHandler:nil];
}
}

- (void)showThemePicker
{
__weak typeof(self) weakSelf = self;
Expand Down
6 changes: 0 additions & 6 deletions RiotSwiftUI/Modules/Common/Util/ListBackground.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,4 @@ extension View {
func listBackgroundColor(_ color: Color) -> some View {
modifier(ListBackgroundModifier(color: color))
}

/// Finds a `UICollectionView` from a `SwiftUI.List`, or `SwiftUI.List` child.
/// Stop gap until https://github.com/siteline/SwiftUI-Introspect/pull/169
func introspectCollectionView(customize: @escaping (UICollectionView) -> Void) -> some View {
introspect(selector: TargetViewSelector.ancestorOrSiblingContaining, customize: customize)
}
}
Loading

0 comments on commit f6b85b8

Please sign in to comment.