Skip to content

Commit

Permalink
Merge branch 'release/1.10.7/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Anderas committed Mar 22, 2023
2 parents 3569c61 + 43356f4 commit 022d7e7
Show file tree
Hide file tree
Showing 20 changed files with 80 additions and 275 deletions.
7 changes: 7 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## Changes in 1.10.7 (2023-03-22)

🙌 Improvements

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


## Changes in 1.10.6 (2023-03-21)

🙌 Improvements
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.10.6
CURRENT_PROJECT_VERSION = 1.10.6
MARKETING_VERSION = 1.10.7
CURRENT_PROJECT_VERSION = 1.10.7
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.26.2'
$matrixSDKVersion = '= 0.26.4'
# $matrixSDKVersion = :local
# $matrixSDKVersion = { :branch => 'develop'}
# $matrixSDKVersion = { :specHash => { git: 'https://git.io/fork123', branch: 'fix' } }
Expand Down
16 changes: 8 additions & 8 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,17 @@ PODS:
- LoggerAPI (1.9.200):
- Logging (~> 1.1)
- Logging (1.4.0)
- MatrixSDK (0.26.2):
- MatrixSDK/Core (= 0.26.2)
- MatrixSDK/Core (0.26.2):
- MatrixSDK (0.26.4):
- MatrixSDK/Core (= 0.26.4)
- MatrixSDK/Core (0.26.4):
- AFNetworking (~> 4.0.0)
- GZIP (~> 1.3.0)
- libbase58 (~> 0.1.4)
- MatrixSDKCrypto (= 0.3.0)
- OLMKit (~> 3.2.5)
- Realm (= 10.27.0)
- SwiftyBeaver (= 1.9.5)
- MatrixSDK/JingleCallStack (0.26.2):
- MatrixSDK/JingleCallStack (0.26.4):
- JitsiMeetSDK (= 5.0.2)
- MatrixSDK/Core
- MatrixSDKCrypto (0.3.0)
Expand Down Expand Up @@ -100,8 +100,8 @@ DEPENDENCIES:
- KeychainAccess (~> 4.2.2)
- KTCenterFlowLayout (~> 1.3.1)
- libPhoneNumber-iOS (~> 0.9.13)
- MatrixSDK (= 0.26.2)
- MatrixSDK/JingleCallStack (= 0.26.2)
- MatrixSDK (= 0.26.4)
- MatrixSDK/JingleCallStack (= 0.26.4)
- OLMKit
- PostHog (~> 2.0.0)
- ReadMoreTextView (~> 3.0.1)
Expand Down Expand Up @@ -183,7 +183,7 @@ SPEC CHECKSUMS:
libPhoneNumber-iOS: 0a32a9525cf8744fe02c5206eb30d571e38f7d75
LoggerAPI: ad9c4a6f1e32f518fdb43a1347ac14d765ab5e3d
Logging: beeb016c9c80cf77042d62e83495816847ef108b
MatrixSDK: 010cdccea670b6b2e1a665976bd1a1e6ea5330ca
MatrixSDK: f336fa2ba23d5db48873fa78d3e9565f768a2cda
MatrixSDKCrypto: 05ebe373ccebf40f8a0cff37d8f8b24fd01b9883
OLMKit: da115f16582e47626616874e20f7bb92222c7a51
PostHog: 660ec6c9d80cec17b685e148f17f6785a88b597d
Expand All @@ -204,6 +204,6 @@ SPEC CHECKSUMS:
zxcvbn-ios: fef98b7c80f1512ff0eec47ac1fa399fc00f7e3c
ZXingObjC: fdbb269f25dd2032da343e06f10224d62f537bdb

PODFILE CHECKSUM: 90e256afba3906cdb4c1a3c1eb764abff6843a76
PODFILE CHECKSUM: 741947b0cd7b44554c29e7ca268403622ba770b4

COCOAPODS: 1.11.3
30 changes: 25 additions & 5 deletions Riot/Categories/MXRoom+Riot.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#import "AvatarGenerator.h"
#import "MatrixKit.h"
#import "GeneratedInterface-Swift.h"

#import <objc/runtime.h>

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

MXCrossSigningInfo *crossSigningInfo = [self.mxSession.crypto.crossSigning crossSigningKeysForUser:userId];
EncryptionTrustLevel *encryption = [[EncryptionTrustLevel alloc] init];
UserEncryptionTrustLevel userEncryptionTrustLevel = [encryption userTrustLevelWithCrossSigning:crossSigningInfo
devicesTrust:usersTrustLevelSummary.devicesTrust];
UserEncryptionTrustLevel userEncryptionTrustLevel;
double trustedDevicesPercentage = usersTrustLevelSummary.trustedDevicesProgress.fractionCompleted;

if (trustedDevicesPercentage >= 1.0)
{
userEncryptionTrustLevel = UserEncryptionTrustLevelTrusted;
}
else if (trustedDevicesPercentage == 0.0)
{
// Verify if the user has the user has cross-signing enabled
if ([self.mxSession.crypto.crossSigning crossSigningKeysForUser:userId])
{
userEncryptionTrustLevel = UserEncryptionTrustLevelNotVerified;
}
else
{
userEncryptionTrustLevel = UserEncryptionTrustLevelNoCrossSigning;
}
}
else
{
userEncryptionTrustLevel = UserEncryptionTrustLevelWarning;
}

onComplete(userEncryptionTrustLevel);

} failure:^(NSError *error) {
Expand Down
12 changes: 11 additions & 1 deletion Riot/Categories/MXRoomSummary+Riot.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,17 @@
*/

#import "MatrixKit.h"
#import "RoomEncryptionTrustLevel.h"

/**
RoomEncryptionTrustLevel represents the trust level in an encrypted room.
*/
typedef NS_ENUM(NSUInteger, RoomEncryptionTrustLevel) {
RoomEncryptionTrustLevelTrusted,
RoomEncryptionTrustLevelWarning,
RoomEncryptionTrustLevelNormal,
RoomEncryptionTrustLevelUnknown
};


/**
Define a `MXRoomSummary` category at Riot level.
Expand Down
29 changes: 23 additions & 6 deletions Riot/Categories/MXRoomSummary+Riot.m
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,32 @@ - (void)setRoomAvatarImageIn:(MXKImageView*)mxkImageView

- (RoomEncryptionTrustLevel)roomEncryptionTrustLevel
{
MXUsersTrustLevelSummary *trust = self.trust;
if (!trust)
RoomEncryptionTrustLevel roomEncryptionTrustLevel = RoomEncryptionTrustLevelUnknown;
if (self.trust)
{
MXLogError(@"[MXRoomSummary] roomEncryptionTrustLevel: trust is missing");
return RoomEncryptionTrustLevelUnknown;
double trustedUsersPercentage = self.trust.trustedUsersProgress.fractionCompleted;
double trustedDevicesPercentage = self.trust.trustedDevicesProgress.fractionCompleted;

if (trustedUsersPercentage >= 1.0)
{
if (trustedDevicesPercentage >= 1.0)
{
roomEncryptionTrustLevel = RoomEncryptionTrustLevelTrusted;
}
else
{
roomEncryptionTrustLevel = RoomEncryptionTrustLevelWarning;
}
}
else
{
roomEncryptionTrustLevel = RoomEncryptionTrustLevelNormal;
}

roomEncryptionTrustLevel = roomEncryptionTrustLevel;
}

EncryptionTrustLevel *encryption = [[EncryptionTrustLevel alloc] init];
return [encryption roomTrustLevelWithSummary:trust];
return roomEncryptionTrustLevel;
}

- (BOOL)isJoined
Expand Down
49 changes: 0 additions & 49 deletions Riot/Modules/Encryption/EncryptionTrustLevel.swift

This file was deleted.

25 changes: 0 additions & 25 deletions Riot/Modules/Encryption/RoomEncryptionTrustLevel.h

This file was deleted.

4 changes: 2 additions & 2 deletions Riot/Modules/MatrixKit/Models/Room/MXKRoomBubbleComponent.m
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,10 @@ - (EventEncryptionDecoration)encryptionDecorationForEvent:(MXEvent*)event roomSt
// Only show a warning badge if there are trust issues.
if (event.sender)
{
BOOL isUserVerified = [session.crypto isUserVerified:event.sender];
MXUserTrustLevel *userTrustLevel = [session.crypto trustLevelForUser:event.sender];
MXDeviceInfo *deviceInfo = [session.crypto eventDeviceInfo:event];

if (isUserVerified && !deviceInfo.trustLevel.isVerified)
if (userTrustLevel.isVerified && !deviceInfo.trustLevel.isVerified)
{
return EventEncryptionDecorationUntrustedDevice;
}
Expand Down
1 change: 0 additions & 1 deletion Riot/SupportingFiles/Riot-Bridging-Header.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#import "RoomBubbleCellData.h"
#import "MXKRoomBubbleTableViewCell+Riot.h"
#import "UserEncryptionTrustLevel.h"
#import "RoomEncryptionTrustLevel.h"
#import "RoomReactionsViewSizer.h"
#import "RoomEncryptedDataBubbleCell.h"
#import "LegacyAppDelegate.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
#import "AvatarGenerator.h"
#import "BuildInfo.h"
#import "ShareItemSender.h"
#import "UserEncryptionTrustLevel.h"
#import "RoomEncryptionTrustLevel.h"

// MatrixKit imports
#import "MatrixKit-Bridging-Header.h"
1 change: 0 additions & 1 deletion RiotShareExtension/target.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,3 @@ targets:
- "**/*.md" # excludes all files with the .md extension
- path: ../Riot/Modules/Room/TimelineCells/Styles/RoomTimelineStyleIdentifier.swift
- path: ../Riot/Modules/VoiceBroadcast/VoiceBroadcastSDK/MatrixSDK
- path: ../Riot/Modules/Encryption/EncryptionTrustLevel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ class QRLoginService: NSObject, QRLoginServiceProtocol {

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

0 comments on commit 022d7e7

Please sign in to comment.