Skip to content

Commit 022d7e7

Browse files
committed
Merge branch 'release/1.10.7/master'
2 parents 3569c61 + 43356f4 commit 022d7e7

File tree

20 files changed

+80
-275
lines changed

20 files changed

+80
-275
lines changed

CHANGES.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## Changes in 1.10.7 (2023-03-22)
2+
3+
🙌 Improvements
4+
5+
- Upgrade MatrixSDK version ([v0.26.4](https://github.com/matrix-org/matrix-ios-sdk/releases/tag/v0.26.4)).
6+
7+
18
## Changes in 1.10.6 (2023-03-21)
29

310
🙌 Improvements

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.10.6
19-
CURRENT_PROJECT_VERSION = 1.10.6
18+
MARKETING_VERSION = 1.10.7
19+
CURRENT_PROJECT_VERSION = 1.10.7

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.26.2'
19+
$matrixSDKVersion = '= 0.26.4'
2020
# $matrixSDKVersion = :local
2121
# $matrixSDKVersion = { :branch => 'develop'}
2222
# $matrixSDKVersion = { :specHash => { git: 'https://git.io/fork123', branch: 'fix' } }

Podfile.lock

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,17 @@ PODS:
3737
- LoggerAPI (1.9.200):
3838
- Logging (~> 1.1)
3939
- Logging (1.4.0)
40-
- MatrixSDK (0.26.2):
41-
- MatrixSDK/Core (= 0.26.2)
42-
- MatrixSDK/Core (0.26.2):
40+
- MatrixSDK (0.26.4):
41+
- MatrixSDK/Core (= 0.26.4)
42+
- MatrixSDK/Core (0.26.4):
4343
- AFNetworking (~> 4.0.0)
4444
- GZIP (~> 1.3.0)
4545
- libbase58 (~> 0.1.4)
4646
- MatrixSDKCrypto (= 0.3.0)
4747
- OLMKit (~> 3.2.5)
4848
- Realm (= 10.27.0)
4949
- SwiftyBeaver (= 1.9.5)
50-
- MatrixSDK/JingleCallStack (0.26.2):
50+
- MatrixSDK/JingleCallStack (0.26.4):
5151
- JitsiMeetSDK (= 5.0.2)
5252
- MatrixSDK/Core
5353
- MatrixSDKCrypto (0.3.0)
@@ -100,8 +100,8 @@ DEPENDENCIES:
100100
- KeychainAccess (~> 4.2.2)
101101
- KTCenterFlowLayout (~> 1.3.1)
102102
- libPhoneNumber-iOS (~> 0.9.13)
103-
- MatrixSDK (= 0.26.2)
104-
- MatrixSDK/JingleCallStack (= 0.26.2)
103+
- MatrixSDK (= 0.26.4)
104+
- MatrixSDK/JingleCallStack (= 0.26.4)
105105
- OLMKit
106106
- PostHog (~> 2.0.0)
107107
- ReadMoreTextView (~> 3.0.1)
@@ -183,7 +183,7 @@ SPEC CHECKSUMS:
183183
libPhoneNumber-iOS: 0a32a9525cf8744fe02c5206eb30d571e38f7d75
184184
LoggerAPI: ad9c4a6f1e32f518fdb43a1347ac14d765ab5e3d
185185
Logging: beeb016c9c80cf77042d62e83495816847ef108b
186-
MatrixSDK: 010cdccea670b6b2e1a665976bd1a1e6ea5330ca
186+
MatrixSDK: f336fa2ba23d5db48873fa78d3e9565f768a2cda
187187
MatrixSDKCrypto: 05ebe373ccebf40f8a0cff37d8f8b24fd01b9883
188188
OLMKit: da115f16582e47626616874e20f7bb92222c7a51
189189
PostHog: 660ec6c9d80cec17b685e148f17f6785a88b597d
@@ -204,6 +204,6 @@ SPEC CHECKSUMS:
204204
zxcvbn-ios: fef98b7c80f1512ff0eec47ac1fa399fc00f7e3c
205205
ZXingObjC: fdbb269f25dd2032da343e06f10224d62f537bdb
206206

207-
PODFILE CHECKSUM: 90e256afba3906cdb4c1a3c1eb764abff6843a76
207+
PODFILE CHECKSUM: 741947b0cd7b44554c29e7ca268403622ba770b4
208208

209209
COCOAPODS: 1.11.3

Riot/Categories/MXRoom+Riot.m

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
#import "AvatarGenerator.h"
2222
#import "MatrixKit.h"
23-
#import "GeneratedInterface-Swift.h"
23+
2424
#import <objc/runtime.h>
2525

2626
@implementation MXRoom (Riot)
@@ -331,10 +331,30 @@ - (void)encryptionTrustLevelForUserId:(NSString*)userId onComplete:(void (^)(Use
331331
{
332332
[self.mxSession.crypto trustLevelSummaryForUserIds:@[userId] forceDownload:NO success:^(MXUsersTrustLevelSummary *usersTrustLevelSummary) {
333333

334-
MXCrossSigningInfo *crossSigningInfo = [self.mxSession.crypto.crossSigning crossSigningKeysForUser:userId];
335-
EncryptionTrustLevel *encryption = [[EncryptionTrustLevel alloc] init];
336-
UserEncryptionTrustLevel userEncryptionTrustLevel = [encryption userTrustLevelWithCrossSigning:crossSigningInfo
337-
devicesTrust:usersTrustLevelSummary.devicesTrust];
334+
UserEncryptionTrustLevel userEncryptionTrustLevel;
335+
double trustedDevicesPercentage = usersTrustLevelSummary.trustedDevicesProgress.fractionCompleted;
336+
337+
if (trustedDevicesPercentage >= 1.0)
338+
{
339+
userEncryptionTrustLevel = UserEncryptionTrustLevelTrusted;
340+
}
341+
else if (trustedDevicesPercentage == 0.0)
342+
{
343+
// Verify if the user has the user has cross-signing enabled
344+
if ([self.mxSession.crypto.crossSigning crossSigningKeysForUser:userId])
345+
{
346+
userEncryptionTrustLevel = UserEncryptionTrustLevelNotVerified;
347+
}
348+
else
349+
{
350+
userEncryptionTrustLevel = UserEncryptionTrustLevelNoCrossSigning;
351+
}
352+
}
353+
else
354+
{
355+
userEncryptionTrustLevel = UserEncryptionTrustLevelWarning;
356+
}
357+
338358
onComplete(userEncryptionTrustLevel);
339359

340360
} failure:^(NSError *error) {

Riot/Categories/MXRoomSummary+Riot.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,17 @@
1515
*/
1616

1717
#import "MatrixKit.h"
18-
#import "RoomEncryptionTrustLevel.h"
18+
19+
/**
20+
RoomEncryptionTrustLevel represents the trust level in an encrypted room.
21+
*/
22+
typedef NS_ENUM(NSUInteger, RoomEncryptionTrustLevel) {
23+
RoomEncryptionTrustLevelTrusted,
24+
RoomEncryptionTrustLevelWarning,
25+
RoomEncryptionTrustLevelNormal,
26+
RoomEncryptionTrustLevelUnknown
27+
};
28+
1929

2030
/**
2131
Define a `MXRoomSummary` category at Riot level.

Riot/Categories/MXRoomSummary+Riot.m

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,32 @@ - (void)setRoomAvatarImageIn:(MXKImageView*)mxkImageView
3333

3434
- (RoomEncryptionTrustLevel)roomEncryptionTrustLevel
3535
{
36-
MXUsersTrustLevelSummary *trust = self.trust;
37-
if (!trust)
36+
RoomEncryptionTrustLevel roomEncryptionTrustLevel = RoomEncryptionTrustLevelUnknown;
37+
if (self.trust)
3838
{
39-
MXLogError(@"[MXRoomSummary] roomEncryptionTrustLevel: trust is missing");
40-
return RoomEncryptionTrustLevelUnknown;
39+
double trustedUsersPercentage = self.trust.trustedUsersProgress.fractionCompleted;
40+
double trustedDevicesPercentage = self.trust.trustedDevicesProgress.fractionCompleted;
41+
42+
if (trustedUsersPercentage >= 1.0)
43+
{
44+
if (trustedDevicesPercentage >= 1.0)
45+
{
46+
roomEncryptionTrustLevel = RoomEncryptionTrustLevelTrusted;
47+
}
48+
else
49+
{
50+
roomEncryptionTrustLevel = RoomEncryptionTrustLevelWarning;
51+
}
52+
}
53+
else
54+
{
55+
roomEncryptionTrustLevel = RoomEncryptionTrustLevelNormal;
56+
}
57+
58+
roomEncryptionTrustLevel = roomEncryptionTrustLevel;
4159
}
4260

43-
EncryptionTrustLevel *encryption = [[EncryptionTrustLevel alloc] init];
44-
return [encryption roomTrustLevelWithSummary:trust];
61+
return roomEncryptionTrustLevel;
4562
}
4663

4764
- (BOOL)isJoined

Riot/Modules/Encryption/EncryptionTrustLevel.swift

Lines changed: 0 additions & 49 deletions
This file was deleted.

Riot/Modules/Encryption/RoomEncryptionTrustLevel.h

Lines changed: 0 additions & 25 deletions
This file was deleted.

Riot/Modules/MatrixKit/Models/Room/MXKRoomBubbleComponent.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,10 +206,10 @@ - (EventEncryptionDecoration)encryptionDecorationForEvent:(MXEvent*)event roomSt
206206
// Only show a warning badge if there are trust issues.
207207
if (event.sender)
208208
{
209-
BOOL isUserVerified = [session.crypto isUserVerified:event.sender];
209+
MXUserTrustLevel *userTrustLevel = [session.crypto trustLevelForUser:event.sender];
210210
MXDeviceInfo *deviceInfo = [session.crypto eventDeviceInfo:event];
211211

212-
if (isUserVerified && !deviceInfo.trustLevel.isVerified)
212+
if (userTrustLevel.isVerified && !deviceInfo.trustLevel.isVerified)
213213
{
214214
return EventEncryptionDecorationUntrustedDevice;
215215
}

Riot/SupportingFiles/Riot-Bridging-Header.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#import "RoomBubbleCellData.h"
1919
#import "MXKRoomBubbleTableViewCell+Riot.h"
2020
#import "UserEncryptionTrustLevel.h"
21-
#import "RoomEncryptionTrustLevel.h"
2221
#import "RoomReactionsViewSizer.h"
2322
#import "RoomEncryptedDataBubbleCell.h"
2423
#import "LegacyAppDelegate.h"

RiotShareExtension/SupportingFiles/RiotShareExtension-Bridging-Header.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
#import "AvatarGenerator.h"
77
#import "BuildInfo.h"
88
#import "ShareItemSender.h"
9-
#import "UserEncryptionTrustLevel.h"
10-
#import "RoomEncryptionTrustLevel.h"
119

1210
// MatrixKit imports
1311
#import "MatrixKit-Bridging-Header.h"

RiotShareExtension/target.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,3 @@ targets:
8787
- "**/*.md" # excludes all files with the .md extension
8888
- path: ../Riot/Modules/Room/TimelineCells/Styles/RoomTimelineStyleIdentifier.swift
8989
- path: ../Riot/Modules/VoiceBroadcast/VoiceBroadcastSDK/MatrixSDK
90-
- path: ../Riot/Modules/Encryption/EncryptionTrustLevel.swift

RiotSwiftUI/Modules/Authentication/QRLogin/Common/Service/MatrixSDK/QRLoginService.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ class QRLoginService: NSObject, QRLoginServiceProtocol {
327327

328328
MXLog.debug("[QRLoginService] Marking the received master key as trusted")
329329
let mskVerificationResult = await withCheckedContinuation { (continuation: CheckedContinuation<Bool, Never>) in
330-
session.crypto.setUserVerificationForUserId(session.myUserId) {
330+
session.crypto.setUserVerification(true, forUser: session.myUserId) {
331331
MXLog.debug("[QRLoginService] Successfully marked the received master key as trusted")
332332
continuation.resume(returning: true)
333333
} failure: { error in

0 commit comments

Comments
 (0)