Skip to content

Commit

Permalink
Merge pull request #874 from tchapgouv/rebase/element-ios-1.11.2
Browse files Browse the repository at this point in the history
Rebase/element ios 1.11.2
  • Loading branch information
NicolasBuquet authored Sep 14, 2023
2 parents d0c9852 + 95979c8 commit ca579de
Show file tree
Hide file tree
Showing 19 changed files with 192 additions and 63 deletions.
1 change: 1 addition & 0 deletions BroadcastUploadExtension/target.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,6 @@ targets:
sources:
- path: .
- path: ../Config/BuildSettings.swift
- path: ../Config/MDMSettings.swift
- path: ../Riot/Categories/Bundle.swift
- path: ../Riot/Modules/Room/TimelineCells/Styles/RoomTimelineStyleIdentifier.swift
12 changes: 12 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
## Changes in 1.11.2 (2023-09-12)

🙌 Improvements

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

🐛 Bugfixes

- Fix an issue where rooms were not correctly sorted after forwarding a message. ([#7641](https://github.com/vector-im/element-ios/issues/7641))
- Add phone number UI and explanatory text is hidden if the 3 pid changes capability is disabled. ([#7670](https://github.com/vector-im/element-ios/issues/7670))


## Changes in 1.11.1 (2023-08-29)

✨ Features
Expand Down
13 changes: 9 additions & 4 deletions Config/BuildSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,16 @@ final class BuildSettings: NSObject {
static let forceHomeserverSelection = false

/// Default server proposed on the authentication screen
static let serverConfigDefaultHomeserverUrlString = "https://matrix.org"
static var serverConfigDefaultHomeserverUrlString: String {
MDMSettings.serverConfigDefaultHomeserverUrlString ?? "https://matrix.org"
}

/// Default identity server
static let serverConfigDefaultIdentityServerUrlString = "https://vector.im"

static let serverConfigSygnalAPIUrlString = "https://matrix.org/_matrix/push/v1/notify"

static var serverConfigSygnalAPIUrlString: String {
MDMSettings.serverConfigSygnalAPIUrlString ?? "https://matrix.org/_matrix/push/v1/notify"
}

// MARK: - Legal URLs

Expand Down Expand Up @@ -151,7 +154,9 @@ final class BuildSettings: NSObject {
// This baseURL is used to generate permalinks within the app (E.g. timeline message permalinks).
// Optional String that when set is used as permalink base, when nil matrix.to format is used.
// Example value would be "https://www.example.com", note there is no trailing '/'.
static let clientPermalinkBaseUrl: String? = nil
static var clientPermalinkBaseUrl: String? {
MDMSettings.clientPermalinkBaseUrl
}

// MARK: - VoIP
static var allowVoIPUsage: Bool {
Expand Down
52 changes: 52 additions & 0 deletions Config/MDMSettings.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
//
// Copyright 2023 New Vector Ltd
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

import Foundation

enum MDMSettings {
private static let appleManagedConfigurationKey = "com.apple.configuration.managed"

private enum Key: String {
case serverConfigDefaultHomeserverUrlString = "im.vector.app.serverConfigDefaultHomeserverUrlString"
case serverConfigSygnalAPIUrlString = "im.vector.app.serverConfigSygnalAPIUrlString"
case clientPermalinkBaseUrl = "im.vector.app.clientPermalinkBaseUrl"
}

static var serverConfigDefaultHomeserverUrlString: String? {
valueForKey(.serverConfigDefaultHomeserverUrlString) as? String
}

static var serverConfigSygnalAPIUrlString: String? {
valueForKey(.serverConfigSygnalAPIUrlString) as? String
}

static var clientPermalinkBaseUrl: String? {
valueForKey(.clientPermalinkBaseUrl) as? String
}

// MARK: - Private

static private func valueForKey(_ key: Key) -> Any? {
guard let managedConfiguration = UserDefaults.standard.dictionary(forKey: appleManagedConfigurationKey) else {
print("MDM configuration missing")
return nil
}

print("Retrieved MDM configuration: \(managedConfiguration)")

return managedConfiguration[key.rawValue]
}
}
19 changes: 19 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,25 @@ Be sure to use compatible branches for Element iOS and MatrixSDK. For example, i

**Important**: By working with [XcodeGen](https://github.com/yonaskolb/XcodeGen) you will need to use the _New Build System_ in Xcode, to have your some of the xcconfig variables taken into account. It should be enabled by default on the latest Xcode versions, but if you need to enable it go to Xcode menu and select `File > Workspace Settings… > Build System` and then choose `New Build System`.

- **Running a local rust MatrixCryptoSDK locally**

If you want to debug locally or test local changes of the rust `MatrixSDKCrypto` with a local `MatrixSDK`, you must checkout [matrix-rust-sdk](https://github.com/matrix-org/matrix-rust-sdk), and follow the [instructions in the repository](https://github.com/matrix-org/matrix-rust-sdk/tree/main/bindings/apple).

Once the framework is built using `./build_crypto_xcframework.sh` you will have to move `bindings/apple/MatrixSDKCrypto-Local.podspec` to the root of the `matrix-rust-sdk` folder and rename it to `MatrixSDKCrypto.podspec` then update `s.version` with the current pod version:

```
s.version = "0.3.12"
```

Then in the element-ios `Podfile`, add the following line under the existing `pod 'MatrixSDK' [..]`:

```
pod 'MatrixSDKCrypto', :path => '../matrix-rust-sdk/MatrixSDKCrypto.podspec'
```

Run `pod install` to refresh all.


### `$matrixSDKVersion` Modification

Every time you change the `$matrixSDKVersion` variable in the `Podfile`, you have to run the `pod install` command again.
Expand Down
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.1'
$matrixSDKVersion = '= 0.27.2'
# $matrixSDKVersion = :local
# $matrixSDKVersion = { :branch => 'develop'}
# $matrixSDKVersion = { :specHash => { git: 'https://git.io/fork123', branch: 'fix' } }
Expand Down
24 changes: 12 additions & 12 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.11.0)
- Introspect (0.12.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.1):
- MatrixSDK/Core (= 0.27.1)
- MatrixSDK/Core (0.27.1):
- MatrixSDK (0.27.2):
- MatrixSDK/Core (= 0.27.2)
- MatrixSDK/Core (0.27.2):
- 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.1):
- MatrixSDK/JingleCallStack (0.27.2):
- JitsiMeetSDKLite (= 8.1.2-lite)
- MatrixSDK/Core
- MatrixSDKCrypto (0.3.12)
Expand All @@ -58,7 +58,7 @@ PODS:
- OLMKit/olmcpp (= 3.2.12)
- OLMKit/olmc (3.2.12)
- OLMKit/olmcpp (3.2.12)
- PostHog (2.0.0)
- PostHog (2.0.2)
- ReadMoreTextView (3.0.1)
- Realm (10.27.0):
- Realm/Headers (= 10.27.0)
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.1)
- MatrixSDK/JingleCallStack (= 0.27.1)
- MatrixSDK (= 0.27.2)
- MatrixSDK/JingleCallStack (= 0.27.2)
- 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: 4cc1e4c34dd016540c8d86a591c231c09dafbee3
Introspect: b66b675de8a85d9ef832f3a710d8e3c7db186884
JitsiMeetSDKLite: 895213158cf62342069a10634a41d2f1c00057f7
JitsiWebRTC: 80f62908fcf2a1160e0d14b584323fb6e6be630b
KeychainAccess: c0c4f7f38f6fc7bbe58f5702e25f7bd2f65abf51
Expand All @@ -187,10 +187,10 @@ SPEC CHECKSUMS:
libPhoneNumber-iOS: 0a32a9525cf8744fe02c5206eb30d571e38f7d75
LoggerAPI: ad9c4a6f1e32f518fdb43a1347ac14d765ab5e3d
Logging: beeb016c9c80cf77042d62e83495816847ef108b
MatrixSDK: f6c197ca06aab29ff69d1105965a57d277dfcd9d
MatrixSDK: a39e229a03a00394e055ffa7490e9602d45f8a44
MatrixSDKCrypto: 25929a40733b4ab54f659aaf6a730552a0a06504
OLMKit: da115f16582e47626616874e20f7bb92222c7a51
PostHog: 660ec6c9d80cec17b685e148f17f6785a88b597d
PostHog: f9e5c13ceea86bb5314218c85d16125b797eb332
ReadMoreTextView: 19147adf93abce6d7271e14031a00303fe28720d
Realm: 9ca328bd7e700cc19703799785e37f77d1a130f2
Reusable: 6bae6a5e8aa793c9c441db0213c863a64bce9136
Expand All @@ -208,6 +208,6 @@ SPEC CHECKSUMS:
zxcvbn-ios: fef98b7c80f1512ff0eec47ac1fa399fc00f7e3c
ZXingObjC: fdbb269f25dd2032da343e06f10224d62f537bdb

PODFILE CHECKSUM: 192fb60d741b1abb1c74dc2c261f9dd07a9dca8a
PODFILE CHECKSUM: bdd98ddb1a6b2f5d45b1fc00ccfbf2dbaeeb0ff0

COCOAPODS: 1.11.3
3 changes: 2 additions & 1 deletion Riot/Modules/Room/RoomViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -4604,7 +4604,8 @@ - (void)presentEventForwardingDialogForSelectedEvent:(MXEvent *)selectedEvent
{
ForwardingShareItemSender *shareItemSender = [[ForwardingShareItemSender alloc] initWithEvent:selectedEvent];
self.shareManager = [[ShareManager alloc] initWithShareItemSender:shareItemSender
type:ShareManagerTypeForward];
type:ShareManagerTypeForward
session:self.mainSession];

MXWeakify(self);
[self.shareManager setCompletionCallback:^(ShareManagerResult result) {
Expand Down
35 changes: 18 additions & 17 deletions Riot/Modules/Settings/SettingsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -411,23 +411,24 @@ - (void)updateSections
{
[sectionUserSettings addRowWithTag: USER_SETTINGS_PHONENUMBERS_OFFSET + index];
}
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];
}
if (BuildSettings.settingsScreenAllowAddingPhoneThreepids)
{
[sectionUserSettings addRowWithTag:USER_SETTINGS_ADD_PHONENUMBER_INDEX];
}
if (BuildSettings.settingsScreenShowThreepidExplanatory)
{
NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:[VectorL10n settingsThreePidsManagementInformationPart1] attributes:@{}];
[attributedString appendAttributedString:[[NSAttributedString alloc] initWithString:[VectorL10n settingsThreePidsManagementInformationPart2] attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.tintColor}]];
[attributedString appendAttributedString:[[NSAttributedString alloc] initWithString:[VectorL10n settingsThreePidsManagementInformationPart3] attributes:@{}]];
sectionUserSettings.attributedFooterTitle = attributedString;
// If the threePidChanges is nil we assume the capability to be true
if (!self.mainSession.homeserverCapabilities.threePidChanges ||
self.mainSession.homeserverCapabilities.threePidChanges.enabled) {
if (BuildSettings.settingsScreenAllowAddingEmailThreepids)
{
[sectionUserSettings addRowWithTag:USER_SETTINGS_ADD_EMAIL_INDEX];
}
if (BuildSettings.settingsScreenAllowAddingPhoneThreepids)
{
[sectionUserSettings addRowWithTag:USER_SETTINGS_ADD_PHONENUMBER_INDEX];
}
if (BuildSettings.settingsScreenShowThreepidExplanatory)
{
NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:[VectorL10n settingsThreePidsManagementInformationPart1] attributes:@{}];
[attributedString appendAttributedString:[[NSAttributedString alloc] initWithString:[VectorL10n settingsThreePidsManagementInformationPart2] attributes:@{NSForegroundColorAttributeName: ThemeService.shared.theme.tintColor}]];
[attributedString appendAttributedString:[[NSAttributedString alloc] initWithString:[VectorL10n settingsThreePidsManagementInformationPart3] attributes:@{}]];
sectionUserSettings.attributedFooterTitle = attributedString;
}
}

sectionUserSettings.headerTitle = [VectorL10n settingsUserSettings];
Expand Down
1 change: 1 addition & 0 deletions RiotNSE/target.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ targets:
sources:
- path: .
- path: ../Riot/Managers/Settings/RiotSettings.swift
- path: ../Config/MDMSettings.swift
- path: ../Riot/Utils/DataProtectionHelper.swift
- path: ../Config/CommonConfiguration.swift
- path: ../Riot/Experiments/
Expand Down
1 change: 1 addition & 0 deletions RiotShareExtension/Shared/ForwardingShareItemSender.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class ForwardingShareItemSender: NSObject, ShareItemSenderProtocol {
case .failure(let innerError):
errors.append(innerError)
default:
room.summary.resetLastMessage(nil, failure: nil, commit: false)
break
}

Expand Down
4 changes: 3 additions & 1 deletion RiotShareExtension/Shared/ShareManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ typedef NS_ENUM(NSUInteger, ShareManagerResult) {
@property (nonatomic, copy) void (^completionCallback)(ShareManagerResult);

- (instancetype)initWithShareItemSender:(id<ShareItemSenderProtocol>)itemSender
type:(ShareManagerType)type;
type:(ShareManagerType)type
session:(nullable MXSession*)session;


- (UIViewController *)mainViewController;

Expand Down
Loading

0 comments on commit ca579de

Please sign in to comment.