Skip to content

Commit

Permalink
Merge branch 'release/1.10.9/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanceriu committed Apr 4, 2023
2 parents 75b00aa + bfbaf09 commit 9b2c7a6
Show file tree
Hide file tree
Showing 31 changed files with 461 additions and 160 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/triage-incoming.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
add_to_triage:
runs-on: ubuntu-latest
if: >
github.repository == 'vector-im/element-x-ios'
github.repository == 'vector-im/element-ios'
steps:
- uses: octokit/[email protected]
with:
Expand Down
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.10.9 (2023-04-04)

🙌 Improvements

- Encryption: Simplify event encryption decoration ([#7440](https://github.com/vector-im/element-ios/pull/7440))
- Add user suggestions for @room and highlight incoming messages containing @room when the room is encrypted. ([#7453](https://github.com/vector-im/element-ios/pull/7453))
- Crypto: Expand rust crypto rollout to 50% users ([#7466](https://github.com/vector-im/element-ios/pull/7466))
- Upgrade MatrixSDK version ([v0.26.6](https://github.com/matrix-org/matrix-ios-sdk/releases/tag/v0.26.6)).
- Replace Terms and Conditions with Acceptable Use Policy. ([#7456](https://github.com/vector-im/element-ios/issues/7456))
- Crypto: Display correct SDK version ([#7457](https://github.com/vector-im/element-ios/issues/7457))

🐛 Bugfixes

- QR verification: Start scanning as soon as camera ready ([#7469](https://github.com/vector-im/element-ios/pull/7469))
- Timeline: No event decoration if no decryption result ([#7471](https://github.com/vector-im/element-ios/pull/7471))
- Long pills are now truncated. ([#7413](https://github.com/vector-im/element-ios/issues/7413))
- Update the read marker position even if it is not displayed ([#7420](https://github.com/vector-im/element-ios/issues/7420))


## Changes in 1.10.8 (2023-03-28)

🙌 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.8
CURRENT_PROJECT_VERSION = 1.10.8
MARKETING_VERSION = 1.10.9
CURRENT_PROJECT_VERSION = 1.10.9
2 changes: 1 addition & 1 deletion Config/BuildSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ final class BuildSettings: NSObject {
// Note: Set empty strings to hide the related entry in application settings
static let applicationCopyrightUrlString = "https://element.io/copyright"
static let applicationPrivacyPolicyUrlString = "https://element.io/privacy"
static let applicationTermsConditionsUrlString = "https://element.io/terms-of-service"
static let applicationAcceptableUsePolicyUrlString = "https://element.io/acceptable-use-policy-terms"
static let applicationHelpUrlString =
"https://element.io/help"

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.26.5'
$matrixSDKVersion = '= 0.26.6'
# $matrixSDKVersion = :local
# $matrixSDKVersion = { :branch => 'develop'}
# $matrixSDKVersion = { :specHash => { git: 'https://git.io/fork123', branch: 'fix' } }
Expand Down
34 changes: 19 additions & 15 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ PODS:
- GBDeviceInfo/Core (7.1.0)
- GZIP (1.3.0)
- Introspect (0.1.4)
- JitsiMeetSDK (5.0.2)
- JitsiMeetSDKLite (7.0.1-lite):
- JitsiWebRTC (~> 106.0)
- JitsiWebRTC (106.0.0)
- KeychainAccess (4.2.2)
- KituraContracts (1.2.1):
- LoggerAPI (~> 1.7)
Expand All @@ -37,20 +39,20 @@ PODS:
- LoggerAPI (1.9.200):
- Logging (~> 1.1)
- Logging (1.4.0)
- MatrixSDK (0.26.5):
- MatrixSDK/Core (= 0.26.5)
- MatrixSDK/Core (0.26.5):
- MatrixSDK (0.26.6):
- MatrixSDK/Core (= 0.26.6)
- MatrixSDK/Core (0.26.6):
- AFNetworking (~> 4.0.0)
- GZIP (~> 1.3.0)
- libbase58 (~> 0.1.4)
- MatrixSDKCrypto (= 0.3.0)
- MatrixSDKCrypto (= 0.3.2)
- OLMKit (~> 3.2.5)
- Realm (= 10.27.0)
- SwiftyBeaver (= 1.9.5)
- MatrixSDK/JingleCallStack (0.26.5):
- JitsiMeetSDK (= 5.0.2)
- MatrixSDK/JingleCallStack (0.26.6):
- JitsiMeetSDKLite (= 7.0.1-lite)
- MatrixSDK/Core
- MatrixSDKCrypto (0.3.0)
- MatrixSDKCrypto (0.3.2)
- OLMKit (3.2.12):
- OLMKit/olmc (= 3.2.12)
- OLMKit/olmcpp (= 3.2.12)
Expand Down Expand Up @@ -100,8 +102,8 @@ DEPENDENCIES:
- KeychainAccess (~> 4.2.2)
- KTCenterFlowLayout (~> 1.3.1)
- libPhoneNumber-iOS (~> 0.9.13)
- MatrixSDK (= 0.26.5)
- MatrixSDK/JingleCallStack (= 0.26.5)
- MatrixSDK (= 0.26.6)
- MatrixSDK/JingleCallStack (= 0.26.6)
- OLMKit
- PostHog (~> 2.0.0)
- ReadMoreTextView (~> 3.0.1)
Expand Down Expand Up @@ -133,7 +135,8 @@ SPEC REPOS:
- GBDeviceInfo
- GZIP
- Introspect
- JitsiMeetSDK
- JitsiMeetSDKLite
- JitsiWebRTC
- KeychainAccess
- KituraContracts
- KTCenterFlowLayout
Expand Down Expand Up @@ -175,16 +178,17 @@ SPEC CHECKSUMS:
GBDeviceInfo: 5d62fa85bdcce3ed288d83c28789adf1173e4376
GZIP: 416858efbe66b41b206895ac6dfd5493200d95b3
Introspect: b62c4dd2063072327c21d618ef2bedc3c87bc366
JitsiMeetSDK: edcac8e2b92ee0c7f3e75bd0aefefbe9faccfc93
JitsiMeetSDKLite: d59573336ce887ec52327a9927aa8443f560d0b9
JitsiWebRTC: f441eb0e2d67f0588bf24e21c5162e97342714fb
KeychainAccess: c0c4f7f38f6fc7bbe58f5702e25f7bd2f65abf51
KituraContracts: e845e60dc8627ad0a76fa55ef20a45451d8f830b
KTCenterFlowLayout: 6e02b50ab2bd865025ae82fe266ed13b6d9eaf97
libbase58: 7c040313537b8c44b6e2d15586af8e21f7354efd
libPhoneNumber-iOS: 0a32a9525cf8744fe02c5206eb30d571e38f7d75
LoggerAPI: ad9c4a6f1e32f518fdb43a1347ac14d765ab5e3d
Logging: beeb016c9c80cf77042d62e83495816847ef108b
MatrixSDK: 6711f8925fc3767ab7f52fd0c5d4c0380f2109c3
MatrixSDKCrypto: 05ebe373ccebf40f8a0cff37d8f8b24fd01b9883
MatrixSDK: 8179c184d819782282f47dab16ce6c2b68ef8a74
MatrixSDKCrypto: 7073c382c484cb8ba7dba0a83e112ead96d3bbfd
OLMKit: da115f16582e47626616874e20f7bb92222c7a51
PostHog: 660ec6c9d80cec17b685e148f17f6785a88b597d
ReadMoreTextView: 19147adf93abce6d7271e14031a00303fe28720d
Expand All @@ -204,6 +208,6 @@ SPEC CHECKSUMS:
zxcvbn-ios: fef98b7c80f1512ff0eec47ac1fa399fc00f7e3c
ZXingObjC: fdbb269f25dd2032da343e06f10224d62f537bdb

PODFILE CHECKSUM: b87055864fa0465c098334ad789366081a7f9c3c
PODFILE CHECKSUM: 54848168ab5303c9126626395886cd85f27a44b3

COCOAPODS: 1.11.3
1 change: 1 addition & 0 deletions Riot/Assets/en.lproj/Vector.strings
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,7 @@ Tap the + to start adding people.";
"settings_olm_version" = "Olm Version %@";
"settings_copyright" = "Copyright";
"settings_term_conditions" = "Terms & Conditions";
"settings_acceptable_use" = "Acceptable Use Policy";
"settings_privacy_policy" = "Privacy Policy";
"settings_third_party_notices" = "Third-party Notices";
"settings_analytics_and_crash_data" = "Send crash and analytics data";
Expand Down
7 changes: 7 additions & 0 deletions Riot/Categories/MXBugReportRestClient+Riot.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ extension MXBugReportRestClient {
dateFormatter.timeZone = TimeZone(identifier: "UTC")
userInfo["utc_time"] = dateFormatter.string(from: currentDate)

// SDKs
userInfo["matrix_sdk_version"] = MatrixSDKVersion
userInfo["crypto_module"] = MXSDKOptions.sharedInstance().cryptoModuleId
if let crypto = mainAccount?.mxSession?.crypto {
userInfo["crypto_module_version"] = crypto.version
}

if let customFields = customFields {
// combine userInfo with custom fields overriding with custom where there is a conflict
userInfo.merge(customFields) { (_, new) in new }
Expand Down
7 changes: 1 addition & 6 deletions Riot/Experiments/CryptoSDKFeature.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ import MatrixSDKCrypto
@objc class CryptoSDKFeature: NSObject, MXCryptoV2Feature {
@objc static let shared = CryptoSDKFeature()

var version: String {
// Will be moved into the olm machine as API
Bundle(for: OlmMachine.self).infoDictionary?["CFBundleShortVersionString"] as? String ?? ""
}

var isEnabled: Bool {
RiotSettings.shared.enableCryptoSDK
}
Expand All @@ -57,7 +52,7 @@ import MatrixSDKCrypto

init(
remoteFeature: RemoteFeaturesClientProtocol = PostHogAnalyticsClient.shared,
localTargetPercentage: Double = 0.2
localTargetPercentage: Double = 0.5
) {
self.remoteFeature = remoteFeature
self.localFeature = PhasedRolloutFeature(
Expand Down
4 changes: 4 additions & 0 deletions Riot/Generated/Strings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7219,6 +7219,10 @@ public class VectorL10n: NSObject {
public static var settingsAbout: String {
return VectorL10n.tr("Vector", "settings_about")
}
/// Acceptable Use Policy
public static var settingsAcceptableUse: String {
return VectorL10n.tr("Vector", "settings_acceptable_use")
}
/// Invalid credentials
public static var settingsAdd3pidInvalidPasswordMessage: String {
return VectorL10n.tr("Vector", "settings_add_3pid_invalid_password_message")
Expand Down
28 changes: 13 additions & 15 deletions Riot/Modules/MatrixKit/Models/Room/MXKRoomBubbleComponent.m
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ - (EventEncryptionDecoration)encryptionDecorationForEvent:(MXEvent*)event roomSt
// Always show a warning badge if there was a decryption error.
if (event.decryptionError)
{
return EventEncryptionDecorationDecryptionError;
return EventEncryptionDecorationRed;
}

// Unencrypted message events should show a warning unless they're pending local echoes
Expand All @@ -199,29 +199,27 @@ - (EventEncryptionDecoration)encryptionDecorationForEvent:(MXEvent*)event roomSt
return EventEncryptionDecorationNone;
}

return EventEncryptionDecorationNotEncrypted;
return EventEncryptionDecorationRed;
}

// The encryption is in a good state.
// Only show a warning badge if there are trust issues.
if (event.sender)
// Only show a warning badge if there are decryption trust issues.
if (event.decryptionDecoration)
{
MXUserTrustLevel *userTrustLevel = [session.crypto trustLevelForUser:event.sender];
MXDeviceInfo *deviceInfo = [session.crypto eventDeviceInfo:event];

if (userTrustLevel.isVerified && !deviceInfo.trustLevel.isVerified)
switch (event.decryptionDecoration.color)
{
return EventEncryptionDecorationUntrustedDevice;
case MXEventDecryptionDecorationColorNone:
return EventEncryptionDecorationNone;
case MXEventDecryptionDecorationColorGrey:
return EventEncryptionDecorationGrey;
case MXEventDecryptionDecorationColorRed:
return EventEncryptionDecorationRed;
}
}

if (event.isUntrusted)
else
{
return EventEncryptionDecorationUnsafeKey;
return EventEncryptionDecorationNone;
}

// Everything was fine
return EventEncryptionDecorationNone;
}

@end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,13 @@ - (void)updateTextViewText
NSString *claimedKey = _mxEvent.keysClaimed[@"ed25519"];
NSString *algorithm = _mxEvent.wireContent[@"algorithm"];
NSString *sessionId = _mxEvent.wireContent[@"session_id"];
NSString *untrusted = _mxEvent.isUntrusted ? [VectorL10n roomEventEncryptionInfoKeyAuthenticityNotGuaranteed] : [VectorL10n userVerificationSessionsListSessionTrusted];
NSString *safetyMessage = _mxEvent.decryptionDecoration.message;
if (!safetyMessage)
{
// Use default copy if none is provided by the decryption decoration
BOOL isUntrusted = _mxEvent.decryptionDecoration && _mxEvent.decryptionDecoration.color != MXEventDecryptionDecorationColorNone;
safetyMessage = isUntrusted ? [VectorL10n roomEventEncryptionInfoKeyAuthenticityNotGuaranteed] : [VectorL10n userVerificationSessionsListSessionTrusted];
}

NSString *decryptionError;
if (_mxEvent.decryptionError)
Expand All @@ -218,7 +224,8 @@ - (void)updateTextViewText
}

[eventInformationString appendAttributedString:[[NSMutableAttributedString alloc]
initWithString:[VectorL10n roomEventEncryptionInfoEventUserId] attributes:@{NSForegroundColorAttributeName: _defaultTextColor,
initWithString:[VectorL10n roomEventEncryptionInfoEventUserId]
attributes:@{NSForegroundColorAttributeName: _defaultTextColor,
NSFontAttributeName: [UIFont boldSystemFontOfSize:14]}]];
[eventInformationString appendAttributedString:[[NSMutableAttributedString alloc]
initWithString:senderId
Expand Down Expand Up @@ -284,7 +291,7 @@ - (void)updateTextViewText
attributes:@{NSForegroundColorAttributeName: _defaultTextColor,
NSFontAttributeName: [UIFont boldSystemFontOfSize:14]}]];
[eventInformationString appendAttributedString:[[NSMutableAttributedString alloc]
initWithString:untrusted
initWithString:safetyMessage
attributes:@{NSForegroundColorAttributeName: _defaultTextColor,
NSFontAttributeName: [UIFont systemFontOfSize:14]}]];
[eventInformationString appendAttributedString:[MXKEncryptionInfoView verticalWhitespace]];
Expand Down Expand Up @@ -368,20 +375,23 @@ - (void)updateTextViewText
[deviceInformationString appendAttributedString:[MXKEncryptionInfoView verticalWhitespace]];

[deviceInformationString appendAttributedString:[[NSMutableAttributedString alloc]
initWithString:[VectorL10n roomEventEncryptionInfoDeviceId] attributes:@{NSForegroundColorAttributeName: _defaultTextColor, NSFontAttributeName: [UIFont boldSystemFontOfSize:14]}]];
initWithString:[VectorL10n roomEventEncryptionInfoDeviceId]
attributes:@{NSForegroundColorAttributeName: _defaultTextColor, NSFontAttributeName: [UIFont boldSystemFontOfSize:14]}]];
[deviceInformationString appendAttributedString:[[NSMutableAttributedString alloc]
initWithString:deviceId
attributes:@{NSForegroundColorAttributeName: _defaultTextColor,
NSFontAttributeName: [UIFont systemFontOfSize:14]}]];
[deviceInformationString appendAttributedString:[MXKEncryptionInfoView verticalWhitespace]];

[deviceInformationString appendAttributedString:[[NSMutableAttributedString alloc]
initWithString:[VectorL10n roomEventEncryptionInfoDeviceVerification] attributes:@{NSForegroundColorAttributeName: _defaultTextColor, NSFontAttributeName: [UIFont boldSystemFontOfSize:14]}]];
initWithString:[VectorL10n roomEventEncryptionInfoDeviceVerification]
attributes:@{NSForegroundColorAttributeName: _defaultTextColor, NSFontAttributeName: [UIFont boldSystemFontOfSize:14]}]];
[deviceInformationString appendAttributedString:verification];
[deviceInformationString appendAttributedString:[MXKEncryptionInfoView verticalWhitespace]];

[deviceInformationString appendAttributedString:[[NSMutableAttributedString alloc]
initWithString:[VectorL10n roomEventEncryptionInfoDeviceFingerprint] attributes:@{NSForegroundColorAttributeName: _defaultTextColor, NSFontAttributeName: [UIFont boldSystemFontOfSize:14]}]];
initWithString:[VectorL10n roomEventEncryptionInfoDeviceFingerprint]
attributes:@{NSForegroundColorAttributeName: _defaultTextColor, NSFontAttributeName: [UIFont boldSystemFontOfSize:14]}]];
[deviceInformationString appendAttributedString:[[NSMutableAttributedString alloc]
initWithString:fingerprint
attributes:@{NSForegroundColorAttributeName: _defaultTextColor,
Expand All @@ -392,7 +402,8 @@ - (void)updateTextViewText
{
// Unknown device
[deviceInformationString appendAttributedString:[[NSMutableAttributedString alloc]
initWithString:[VectorL10n roomEventEncryptionInfoDeviceUnknown] attributes:@{NSForegroundColorAttributeName: _defaultTextColor, NSFontAttributeName: [UIFont italicSystemFontOfSize:14]}]];
initWithString:[VectorL10n roomEventEncryptionInfoDeviceUnknown]
attributes:@{NSForegroundColorAttributeName: _defaultTextColor, NSFontAttributeName: [UIFont italicSystemFontOfSize:14]}]];
}

[textViewAttributedString appendAttributedString:deviceInformationString];
Expand Down Expand Up @@ -462,7 +473,8 @@ - (IBAction)onButtonPressed:(id)sender
{
// Prompt user
NSMutableAttributedString *textViewAttributedString = [[NSMutableAttributedString alloc]
initWithString:[VectorL10n roomEventEncryptionVerifyTitle] attributes:@{NSForegroundColorAttributeName: _defaultTextColor,
initWithString:[VectorL10n roomEventEncryptionVerifyTitle]
attributes:@{NSForegroundColorAttributeName: _defaultTextColor,
NSFontAttributeName: [UIFont boldSystemFontOfSize:17]}];

NSString *message = [VectorL10n roomEventEncryptionVerifyMessage:_mxDeviceInfo.displayName :_mxDeviceInfo.deviceId :_mxDeviceInfo.fingerprint];
Expand Down
9 changes: 5 additions & 4 deletions Riot/Modules/Pills/PillAttachmentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ class PillAttachmentView: UIView {
label.font = pillData.font
label.textColor = pillData.isHighlighted ? theme.baseTextPrimaryColor : theme.textPrimaryColor
label.translatesAutoresizingMaskIntoConstraints = false
label.setContentCompressionResistancePriority(.defaultHigh, for: .horizontal)
stack.addArrangedSubview(label)

computedWidth += label.sizeThatFits(CGSize(width: CGFloat.greatestFiniteMagnitude, height: sizes.pillBackgroundHeight)).width
Expand Down Expand Up @@ -146,10 +145,12 @@ class PillAttachmentView: UIView {
computedWidth += 2 * sizes.horizontalMargin
}

computedWidth = min(pillData.maxWidth, computedWidth)

let pillBackgroundView = UIView(frame: CGRect(x: 0,
y: sizes.verticalMargin,
width: computedWidth,
height: sizes.pillBackgroundHeight))
y: sizes.verticalMargin,
width: computedWidth,
height: sizes.pillBackgroundHeight))

pillBackgroundView.vc_addSubViewMatchingParent(stack, withInsets: UIEdgeInsets(top: sizes.verticalMargin, left: leadingStackMargin, bottom: -sizes.verticalMargin, right: -sizes.horizontalMargin))

Expand Down
Loading

0 comments on commit 9b2c7a6

Please sign in to comment.