mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-05 11:58:32 +00:00
Fix a bug where the room state wouldn't indicate when a call was in progress. (#3442)
* Fix breaking changes on decryption errors and sending failures. * Update SDK and analytics events. * Add extra UTD strings. --------- Co-authored-by: Stefan Ceriu <stefan.ceriu@gmail.com>
This commit is contained in:
@@ -7822,7 +7822,7 @@
|
|||||||
repositoryURL = "https://github.com/element-hq/matrix-rust-components-swift";
|
repositoryURL = "https://github.com/element-hq/matrix-rust-components-swift";
|
||||||
requirement = {
|
requirement = {
|
||||||
kind = exactVersion;
|
kind = exactVersion;
|
||||||
version = 1.0.60;
|
version = 1.0.61;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
701C7BEF8F70F7A83E852DCC /* XCRemoteSwiftPackageReference "GZIP" */ = {
|
701C7BEF8F70F7A83E852DCC /* XCRemoteSwiftPackageReference "GZIP" */ = {
|
||||||
@@ -7862,7 +7862,7 @@
|
|||||||
repositoryURL = "https://github.com/matrix-org/matrix-analytics-events";
|
repositoryURL = "https://github.com/matrix-org/matrix-analytics-events";
|
||||||
requirement = {
|
requirement = {
|
||||||
kind = upToNextMinorVersion;
|
kind = upToNextMinorVersion;
|
||||||
minimumVersion = 0.25.0;
|
minimumVersion = 0.27.0;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
C13F55E4518415CB4C278E73 /* XCRemoteSwiftPackageReference "DTCoreText" */ = {
|
C13F55E4518415CB4C278E73 /* XCRemoteSwiftPackageReference "DTCoreText" */ = {
|
||||||
|
|||||||
@@ -6,8 +6,8 @@
|
|||||||
"kind" : "remoteSourceControl",
|
"kind" : "remoteSourceControl",
|
||||||
"location" : "https://github.com/element-hq/compound-design-tokens",
|
"location" : "https://github.com/element-hq/compound-design-tokens",
|
||||||
"state" : {
|
"state" : {
|
||||||
"revision" : "2af7bb571eb30cbfbd67cdda6617500507ef46aa",
|
"revision" : "976db67b849775799b4153e7894d61e90fc96888",
|
||||||
"version" : "1.8.0"
|
"version" : "1.9.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -131,8 +131,8 @@
|
|||||||
"kind" : "remoteSourceControl",
|
"kind" : "remoteSourceControl",
|
||||||
"location" : "https://github.com/matrix-org/matrix-analytics-events",
|
"location" : "https://github.com/matrix-org/matrix-analytics-events",
|
||||||
"state" : {
|
"state" : {
|
||||||
"revision" : "c9b40120a5f7b8ce1bab3f09f8417fdc9407f006",
|
"revision" : "9bd3c57e84f87d56b69862369f3b9da714d1d151",
|
||||||
"version" : "0.25.0"
|
"version" : "0.27.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -149,8 +149,8 @@
|
|||||||
"kind" : "remoteSourceControl",
|
"kind" : "remoteSourceControl",
|
||||||
"location" : "https://github.com/element-hq/matrix-rust-components-swift",
|
"location" : "https://github.com/element-hq/matrix-rust-components-swift",
|
||||||
"state" : {
|
"state" : {
|
||||||
"revision" : "dc3a2199b0e87824ccf06d1207487d2e49c5e584",
|
"revision" : "2e6378514e79a648d436e8faeb8cd8106910cf0b",
|
||||||
"version" : "1.0.60"
|
"version" : "1.0.61"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -241,6 +241,8 @@
|
|||||||
"common.pinned" = "Pinned";
|
"common.pinned" = "Pinned";
|
||||||
"common.send_to" = "Send to";
|
"common.send_to" = "Send to";
|
||||||
"common.you" = "You";
|
"common.you" = "You";
|
||||||
|
"common_unable_to_decrypt_insecure_device" = "Sent from an insecure device";
|
||||||
|
"common_unable_to_decrypt_verification_violation" = "Sender's verified identity has changed";
|
||||||
"confirm_recovery_key_banner_message" = "Your chat backup is currently out of sync. You need to enter your recovery key to maintain access to your chat backup.";
|
"confirm_recovery_key_banner_message" = "Your chat backup is currently out of sync. You need to enter your recovery key to maintain access to your chat backup.";
|
||||||
"confirm_recovery_key_banner_title" = "Enter your recovery key";
|
"confirm_recovery_key_banner_title" = "Enter your recovery key";
|
||||||
"crash_detection_dialog_content" = "%1$@ crashed the last time it was used. Would you like to share a crash report with us?";
|
"crash_detection_dialog_content" = "%1$@ crashed the last time it was used. Would you like to share a crash report with us?";
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ class UserSessionFlowCoordinator: FlowCoordinatorProtocol {
|
|||||||
/// For testing purposes.
|
/// For testing purposes.
|
||||||
var statePublisher: AnyPublisher<UserSessionFlowCoordinatorStateMachine.State, Never> { stateMachine.statePublisher }
|
var statePublisher: AnyPublisher<UserSessionFlowCoordinatorStateMachine.State, Never> { stateMachine.statePublisher }
|
||||||
|
|
||||||
|
// swiftlint:disable:next function_body_length
|
||||||
init(userSession: UserSessionProtocol,
|
init(userSession: UserSessionProtocol,
|
||||||
navigationRootCoordinator: NavigationRootCoordinator,
|
navigationRootCoordinator: NavigationRootCoordinator,
|
||||||
appLockService: AppLockServiceProtocol,
|
appLockService: AppLockServiceProtocol,
|
||||||
@@ -158,9 +159,15 @@ class UserSessionFlowCoordinator: FlowCoordinatorProtocol {
|
|||||||
|
|
||||||
switch info.cause {
|
switch info.cause {
|
||||||
case .unknown:
|
case .unknown:
|
||||||
analytics.trackError(context: nil, domain: .E2EE, name: .OlmKeysNotSentError, timeToDecryptMillis: timeToDecryptMs)
|
analytics.trackError(context: nil, domain: .E2EE, name: .UnknownError, timeToDecryptMillis: timeToDecryptMs)
|
||||||
case .membership:
|
case .unknownDevice:
|
||||||
analytics.trackError(context: nil, domain: .E2EE, name: .HistoricalMessage, timeToDecryptMillis: timeToDecryptMs)
|
analytics.trackError(context: nil, domain: .E2EE, name: .ExpectedSentByInsecureDevice, timeToDecryptMillis: timeToDecryptMs)
|
||||||
|
case .unsignedDevice:
|
||||||
|
analytics.trackError(context: nil, domain: .E2EE, name: .ExpectedSentByInsecureDevice, timeToDecryptMillis: timeToDecryptMs)
|
||||||
|
case .verificationViolation:
|
||||||
|
analytics.trackError(context: nil, domain: .E2EE, name: .ExpectedVerificationViolation, timeToDecryptMillis: timeToDecryptMs)
|
||||||
|
case .sentBeforeWeJoined:
|
||||||
|
analytics.trackError(context: nil, domain: .E2EE, name: .ExpectedDueToMembership, timeToDecryptMillis: timeToDecryptMs)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.store(in: &cancellables)
|
.store(in: &cancellables)
|
||||||
|
|||||||
@@ -488,8 +488,12 @@ internal enum L10n {
|
|||||||
internal static var commonTouchIdIos: String { return L10n.tr("Localizable", "common_touch_id_ios") }
|
internal static var commonTouchIdIos: String { return L10n.tr("Localizable", "common_touch_id_ios") }
|
||||||
/// Unable to decrypt
|
/// Unable to decrypt
|
||||||
internal static var commonUnableToDecrypt: String { return L10n.tr("Localizable", "common_unable_to_decrypt") }
|
internal static var commonUnableToDecrypt: String { return L10n.tr("Localizable", "common_unable_to_decrypt") }
|
||||||
|
/// Sent from an insecure device
|
||||||
|
internal static var commonUnableToDecryptInsecureDevice: String { return L10n.tr("Localizable", "common_unable_to_decrypt_insecure_device") }
|
||||||
/// You don't have access to this message
|
/// You don't have access to this message
|
||||||
internal static var commonUnableToDecryptNoAccess: String { return L10n.tr("Localizable", "common_unable_to_decrypt_no_access") }
|
internal static var commonUnableToDecryptNoAccess: String { return L10n.tr("Localizable", "common_unable_to_decrypt_no_access") }
|
||||||
|
/// Sender's verified identity has changed
|
||||||
|
internal static var commonUnableToDecryptVerificationViolation: String { return L10n.tr("Localizable", "common_unable_to_decrypt_verification_violation") }
|
||||||
/// Invites couldn't be sent to one or more users.
|
/// Invites couldn't be sent to one or more users.
|
||||||
internal static var commonUnableToInviteMessage: String { return L10n.tr("Localizable", "common_unable_to_invite_message") }
|
internal static var commonUnableToInviteMessage: String { return L10n.tr("Localizable", "common_unable_to_invite_message") }
|
||||||
/// Unable to send invite(s)
|
/// Unable to send invite(s)
|
||||||
|
|||||||
@@ -2837,15 +2837,15 @@ class ClientProxyMock: ClientProxyProtocol {
|
|||||||
}
|
}
|
||||||
//MARK: - knockRoom
|
//MARK: - knockRoom
|
||||||
|
|
||||||
var knockRoomMessageUnderlyingCallsCount = 0
|
var knockRoomViaMessageUnderlyingCallsCount = 0
|
||||||
var knockRoomMessageCallsCount: Int {
|
var knockRoomViaMessageCallsCount: Int {
|
||||||
get {
|
get {
|
||||||
if Thread.isMainThread {
|
if Thread.isMainThread {
|
||||||
return knockRoomMessageUnderlyingCallsCount
|
return knockRoomViaMessageUnderlyingCallsCount
|
||||||
} else {
|
} else {
|
||||||
var returnValue: Int? = nil
|
var returnValue: Int? = nil
|
||||||
DispatchQueue.main.sync {
|
DispatchQueue.main.sync {
|
||||||
returnValue = knockRoomMessageUnderlyingCallsCount
|
returnValue = knockRoomViaMessageUnderlyingCallsCount
|
||||||
}
|
}
|
||||||
|
|
||||||
return returnValue!
|
return returnValue!
|
||||||
@@ -2853,29 +2853,29 @@ class ClientProxyMock: ClientProxyProtocol {
|
|||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
if Thread.isMainThread {
|
if Thread.isMainThread {
|
||||||
knockRoomMessageUnderlyingCallsCount = newValue
|
knockRoomViaMessageUnderlyingCallsCount = newValue
|
||||||
} else {
|
} else {
|
||||||
DispatchQueue.main.sync {
|
DispatchQueue.main.sync {
|
||||||
knockRoomMessageUnderlyingCallsCount = newValue
|
knockRoomViaMessageUnderlyingCallsCount = newValue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var knockRoomMessageCalled: Bool {
|
var knockRoomViaMessageCalled: Bool {
|
||||||
return knockRoomMessageCallsCount > 0
|
return knockRoomViaMessageCallsCount > 0
|
||||||
}
|
}
|
||||||
var knockRoomMessageReceivedArguments: (roomID: String, message: String?)?
|
var knockRoomViaMessageReceivedArguments: (roomID: String, via: [String], message: String?)?
|
||||||
var knockRoomMessageReceivedInvocations: [(roomID: String, message: String?)] = []
|
var knockRoomViaMessageReceivedInvocations: [(roomID: String, via: [String], message: String?)] = []
|
||||||
|
|
||||||
var knockRoomMessageUnderlyingReturnValue: Result<Void, ClientProxyError>!
|
var knockRoomViaMessageUnderlyingReturnValue: Result<Void, ClientProxyError>!
|
||||||
var knockRoomMessageReturnValue: Result<Void, ClientProxyError>! {
|
var knockRoomViaMessageReturnValue: Result<Void, ClientProxyError>! {
|
||||||
get {
|
get {
|
||||||
if Thread.isMainThread {
|
if Thread.isMainThread {
|
||||||
return knockRoomMessageUnderlyingReturnValue
|
return knockRoomViaMessageUnderlyingReturnValue
|
||||||
} else {
|
} else {
|
||||||
var returnValue: Result<Void, ClientProxyError>? = nil
|
var returnValue: Result<Void, ClientProxyError>? = nil
|
||||||
DispatchQueue.main.sync {
|
DispatchQueue.main.sync {
|
||||||
returnValue = knockRoomMessageUnderlyingReturnValue
|
returnValue = knockRoomViaMessageUnderlyingReturnValue
|
||||||
}
|
}
|
||||||
|
|
||||||
return returnValue!
|
return returnValue!
|
||||||
@@ -2883,26 +2883,26 @@ class ClientProxyMock: ClientProxyProtocol {
|
|||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
if Thread.isMainThread {
|
if Thread.isMainThread {
|
||||||
knockRoomMessageUnderlyingReturnValue = newValue
|
knockRoomViaMessageUnderlyingReturnValue = newValue
|
||||||
} else {
|
} else {
|
||||||
DispatchQueue.main.sync {
|
DispatchQueue.main.sync {
|
||||||
knockRoomMessageUnderlyingReturnValue = newValue
|
knockRoomViaMessageUnderlyingReturnValue = newValue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var knockRoomMessageClosure: ((String, String?) async -> Result<Void, ClientProxyError>)?
|
var knockRoomViaMessageClosure: ((String, [String], String?) async -> Result<Void, ClientProxyError>)?
|
||||||
|
|
||||||
func knockRoom(_ roomID: String, message: String?) async -> Result<Void, ClientProxyError> {
|
func knockRoom(_ roomID: String, via: [String], message: String?) async -> Result<Void, ClientProxyError> {
|
||||||
knockRoomMessageCallsCount += 1
|
knockRoomViaMessageCallsCount += 1
|
||||||
knockRoomMessageReceivedArguments = (roomID: roomID, message: message)
|
knockRoomViaMessageReceivedArguments = (roomID: roomID, via: via, message: message)
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
self.knockRoomMessageReceivedInvocations.append((roomID: roomID, message: message))
|
self.knockRoomViaMessageReceivedInvocations.append((roomID: roomID, via: via, message: message))
|
||||||
}
|
}
|
||||||
if let knockRoomMessageClosure = knockRoomMessageClosure {
|
if let knockRoomViaMessageClosure = knockRoomViaMessageClosure {
|
||||||
return await knockRoomMessageClosure(roomID, message)
|
return await knockRoomViaMessageClosure(roomID, via, message)
|
||||||
} else {
|
} else {
|
||||||
return knockRoomMessageReturnValue
|
return knockRoomViaMessageReturnValue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//MARK: - knockRoomAlias
|
//MARK: - knockRoomAlias
|
||||||
|
|||||||
@@ -2208,16 +2208,16 @@ open class ClientSDKMock: MatrixRustSDK.Client {
|
|||||||
|
|
||||||
//MARK: - knock
|
//MARK: - knock
|
||||||
|
|
||||||
open var knockRoomIdOrAliasThrowableError: Error?
|
open var knockRoomIdOrAliasReasonServerNamesThrowableError: Error?
|
||||||
var knockRoomIdOrAliasUnderlyingCallsCount = 0
|
var knockRoomIdOrAliasReasonServerNamesUnderlyingCallsCount = 0
|
||||||
open var knockRoomIdOrAliasCallsCount: Int {
|
open var knockRoomIdOrAliasReasonServerNamesCallsCount: Int {
|
||||||
get {
|
get {
|
||||||
if Thread.isMainThread {
|
if Thread.isMainThread {
|
||||||
return knockRoomIdOrAliasUnderlyingCallsCount
|
return knockRoomIdOrAliasReasonServerNamesUnderlyingCallsCount
|
||||||
} else {
|
} else {
|
||||||
var returnValue: Int? = nil
|
var returnValue: Int? = nil
|
||||||
DispatchQueue.main.sync {
|
DispatchQueue.main.sync {
|
||||||
returnValue = knockRoomIdOrAliasUnderlyingCallsCount
|
returnValue = knockRoomIdOrAliasReasonServerNamesUnderlyingCallsCount
|
||||||
}
|
}
|
||||||
|
|
||||||
return returnValue!
|
return returnValue!
|
||||||
@@ -2225,29 +2225,29 @@ open class ClientSDKMock: MatrixRustSDK.Client {
|
|||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
if Thread.isMainThread {
|
if Thread.isMainThread {
|
||||||
knockRoomIdOrAliasUnderlyingCallsCount = newValue
|
knockRoomIdOrAliasReasonServerNamesUnderlyingCallsCount = newValue
|
||||||
} else {
|
} else {
|
||||||
DispatchQueue.main.sync {
|
DispatchQueue.main.sync {
|
||||||
knockRoomIdOrAliasUnderlyingCallsCount = newValue
|
knockRoomIdOrAliasReasonServerNamesUnderlyingCallsCount = newValue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
open var knockRoomIdOrAliasCalled: Bool {
|
open var knockRoomIdOrAliasReasonServerNamesCalled: Bool {
|
||||||
return knockRoomIdOrAliasCallsCount > 0
|
return knockRoomIdOrAliasReasonServerNamesCallsCount > 0
|
||||||
}
|
}
|
||||||
open var knockRoomIdOrAliasReceivedRoomIdOrAlias: String?
|
open var knockRoomIdOrAliasReasonServerNamesReceivedArguments: (roomIdOrAlias: String, reason: String?, serverNames: [String])?
|
||||||
open var knockRoomIdOrAliasReceivedInvocations: [String] = []
|
open var knockRoomIdOrAliasReasonServerNamesReceivedInvocations: [(roomIdOrAlias: String, reason: String?, serverNames: [String])] = []
|
||||||
|
|
||||||
var knockRoomIdOrAliasUnderlyingReturnValue: Room!
|
var knockRoomIdOrAliasReasonServerNamesUnderlyingReturnValue: Room!
|
||||||
open var knockRoomIdOrAliasReturnValue: Room! {
|
open var knockRoomIdOrAliasReasonServerNamesReturnValue: Room! {
|
||||||
get {
|
get {
|
||||||
if Thread.isMainThread {
|
if Thread.isMainThread {
|
||||||
return knockRoomIdOrAliasUnderlyingReturnValue
|
return knockRoomIdOrAliasReasonServerNamesUnderlyingReturnValue
|
||||||
} else {
|
} else {
|
||||||
var returnValue: Room? = nil
|
var returnValue: Room? = nil
|
||||||
DispatchQueue.main.sync {
|
DispatchQueue.main.sync {
|
||||||
returnValue = knockRoomIdOrAliasUnderlyingReturnValue
|
returnValue = knockRoomIdOrAliasReasonServerNamesUnderlyingReturnValue
|
||||||
}
|
}
|
||||||
|
|
||||||
return returnValue!
|
return returnValue!
|
||||||
@@ -2255,29 +2255,29 @@ open class ClientSDKMock: MatrixRustSDK.Client {
|
|||||||
}
|
}
|
||||||
set {
|
set {
|
||||||
if Thread.isMainThread {
|
if Thread.isMainThread {
|
||||||
knockRoomIdOrAliasUnderlyingReturnValue = newValue
|
knockRoomIdOrAliasReasonServerNamesUnderlyingReturnValue = newValue
|
||||||
} else {
|
} else {
|
||||||
DispatchQueue.main.sync {
|
DispatchQueue.main.sync {
|
||||||
knockRoomIdOrAliasUnderlyingReturnValue = newValue
|
knockRoomIdOrAliasReasonServerNamesUnderlyingReturnValue = newValue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
open var knockRoomIdOrAliasClosure: ((String) async throws -> Room)?
|
open var knockRoomIdOrAliasReasonServerNamesClosure: ((String, String?, [String]) async throws -> Room)?
|
||||||
|
|
||||||
open override func knock(roomIdOrAlias: String) async throws -> Room {
|
open override func knock(roomIdOrAlias: String, reason: String?, serverNames: [String]) async throws -> Room {
|
||||||
if let error = knockRoomIdOrAliasThrowableError {
|
if let error = knockRoomIdOrAliasReasonServerNamesThrowableError {
|
||||||
throw error
|
throw error
|
||||||
}
|
}
|
||||||
knockRoomIdOrAliasCallsCount += 1
|
knockRoomIdOrAliasReasonServerNamesCallsCount += 1
|
||||||
knockRoomIdOrAliasReceivedRoomIdOrAlias = roomIdOrAlias
|
knockRoomIdOrAliasReasonServerNamesReceivedArguments = (roomIdOrAlias: roomIdOrAlias, reason: reason, serverNames: serverNames)
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
self.knockRoomIdOrAliasReceivedInvocations.append(roomIdOrAlias)
|
self.knockRoomIdOrAliasReasonServerNamesReceivedInvocations.append((roomIdOrAlias: roomIdOrAlias, reason: reason, serverNames: serverNames))
|
||||||
}
|
}
|
||||||
if let knockRoomIdOrAliasClosure = knockRoomIdOrAliasClosure {
|
if let knockRoomIdOrAliasReasonServerNamesClosure = knockRoomIdOrAliasReasonServerNamesClosure {
|
||||||
return try await knockRoomIdOrAliasClosure(roomIdOrAlias)
|
return try await knockRoomIdOrAliasReasonServerNamesClosure(roomIdOrAlias, reason, serverNames)
|
||||||
} else {
|
} else {
|
||||||
return knockRoomIdOrAliasReturnValue
|
return knockRoomIdOrAliasReasonServerNamesReturnValue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -195,6 +195,7 @@ class JoinRoomScreenViewModel: JoinRoomScreenViewModelType, JoinRoomScreenViewMo
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
switch await clientProxy.knockRoom(roomID,
|
switch await clientProxy.knockRoom(roomID,
|
||||||
|
via: via,
|
||||||
message: state.bindings.knockMessage.isBlank ? nil : state.bindings.knockMessage) {
|
message: state.bindings.knockMessage.isBlank ? nil : state.bindings.knockMessage) {
|
||||||
case .success:
|
case .success:
|
||||||
state.mode = .knocked
|
state.mode = .knocked
|
||||||
|
|||||||
+4
-2
@@ -17,7 +17,9 @@ struct EncryptedRoomTimelineView: View {
|
|||||||
switch cause {
|
switch cause {
|
||||||
case .unknown:
|
case .unknown:
|
||||||
return \.time
|
return \.time
|
||||||
case .membership:
|
case .sentBeforeWeJoined,
|
||||||
|
.verificationViolation,
|
||||||
|
.insecureDevice:
|
||||||
return \.block
|
return \.block
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
@@ -90,7 +92,7 @@ struct EncryptedRoomTimelineView_Previews: PreviewProvider, TestablePreview {
|
|||||||
private static func expectedItemWith(timestamp: String, isOutgoing: Bool, senderId: String) -> EncryptedRoomTimelineItem {
|
private static func expectedItemWith(timestamp: String, isOutgoing: Bool, senderId: String) -> EncryptedRoomTimelineItem {
|
||||||
EncryptedRoomTimelineItem(id: .randomEvent,
|
EncryptedRoomTimelineItem(id: .randomEvent,
|
||||||
body: L10n.commonUnableToDecryptNoAccess,
|
body: L10n.commonUnableToDecryptNoAccess,
|
||||||
encryptionType: .megolmV1AesSha2(sessionID: "foo", cause: .membership),
|
encryptionType: .megolmV1AesSha2(sessionID: "foo", cause: .sentBeforeWeJoined),
|
||||||
timestamp: timestamp,
|
timestamp: timestamp,
|
||||||
isOutgoing: isOutgoing,
|
isOutgoing: isOutgoing,
|
||||||
isEditable: false,
|
isEditable: false,
|
||||||
|
|||||||
@@ -415,9 +415,9 @@ class ClientProxy: ClientProxyProtocol {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func knockRoom(_ roomID: String, message: String?) async -> Result<Void, ClientProxyError> {
|
func knockRoom(_ roomID: String, via: [String], message: String?) async -> Result<Void, ClientProxyError> {
|
||||||
do {
|
do {
|
||||||
let _ = try await client.knock(roomIdOrAlias: roomID)
|
let _ = try await client.knock(roomIdOrAlias: roomID, reason: nil, serverNames: via)
|
||||||
await waitForRoomToSync(roomID: roomID, timeout: .seconds(30))
|
await waitForRoomToSync(roomID: roomID, timeout: .seconds(30))
|
||||||
return .success(())
|
return .success(())
|
||||||
} catch {
|
} catch {
|
||||||
@@ -428,7 +428,7 @@ class ClientProxy: ClientProxyProtocol {
|
|||||||
|
|
||||||
func knockRoomAlias(_ roomAlias: String, message: String?) async -> Result<Void, ClientProxyError> {
|
func knockRoomAlias(_ roomAlias: String, message: String?) async -> Result<Void, ClientProxyError> {
|
||||||
do {
|
do {
|
||||||
let room = try await client.knock(roomIdOrAlias: roomAlias)
|
let room = try await client.knock(roomIdOrAlias: roomAlias, reason: nil, serverNames: [])
|
||||||
await waitForRoomToSync(roomID: room.id(), timeout: .seconds(30))
|
await waitForRoomToSync(roomID: room.id(), timeout: .seconds(30))
|
||||||
return .success(())
|
return .success(())
|
||||||
} catch {
|
} catch {
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ protocol ClientProxyProtocol: AnyObject, MediaLoaderProtocol {
|
|||||||
|
|
||||||
func joinRoomAlias(_ roomAlias: String) async -> Result<Void, ClientProxyError>
|
func joinRoomAlias(_ roomAlias: String) async -> Result<Void, ClientProxyError>
|
||||||
|
|
||||||
func knockRoom(_ roomID: String, message: String?) async -> Result<Void, ClientProxyError>
|
func knockRoom(_ roomID: String, via: [String], message: String?) async -> Result<Void, ClientProxyError>
|
||||||
|
|
||||||
func knockRoomAlias(_ roomAlias: String, message: String?) async -> Result<Void, ClientProxyError>
|
func knockRoomAlias(_ roomAlias: String, message: String?) async -> Result<Void, ClientProxyError>
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,9 @@ struct RoomEventStringBuilder {
|
|||||||
switch eventItemProxy.content {
|
switch eventItemProxy.content {
|
||||||
case .unableToDecrypt(let encryptedMessage):
|
case .unableToDecrypt(let encryptedMessage):
|
||||||
let errorMessage = switch encryptedMessage {
|
let errorMessage = switch encryptedMessage {
|
||||||
case .megolmV1AesSha2(_, .membership): L10n.commonUnableToDecryptNoAccess
|
case .megolmV1AesSha2(_, .sentBeforeWeJoined): L10n.commonUnableToDecryptNoAccess
|
||||||
|
case .megolmV1AesSha2(_, .verificationViolation): L10n.commonUnableToDecryptVerificationViolation
|
||||||
|
case .megolmV1AesSha2(_, .unknownDevice), .megolmV1AesSha2(_, .unsignedDevice): L10n.commonUnableToDecryptInsecureDevice
|
||||||
default: L10n.commonWaitingForDecryptionKey
|
default: L10n.commonWaitingForDecryptionKey
|
||||||
}
|
}
|
||||||
return prefix(errorMessage, with: displayName)
|
return prefix(errorMessage, with: displayName)
|
||||||
|
|||||||
@@ -83,18 +83,19 @@ class EventTimelineItemProxy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch localSendState {
|
switch localSendState {
|
||||||
case .sendingFailed(_, let isRecoverable):
|
case .sendingFailed(let error, let isRecoverable):
|
||||||
return isRecoverable ? .sending : .sendingFailed(.unknown)
|
switch error {
|
||||||
|
case .identityViolations(let users):
|
||||||
|
return .sendingFailed(.verifiedUser(.changedIdentity(users: users)))
|
||||||
|
case .insecureDevices(let userDeviceMap):
|
||||||
|
return .sendingFailed(.verifiedUser(.hasUnsignedDevice(devices: userDeviceMap)))
|
||||||
|
default:
|
||||||
|
return .sendingFailed(.unknown)
|
||||||
|
}
|
||||||
case .notSentYet:
|
case .notSentYet:
|
||||||
return .sending
|
return .sending
|
||||||
case .sent:
|
case .sent:
|
||||||
return .sent
|
return .sent
|
||||||
case .verifiedUserHasUnsignedDevice(devices: let devices):
|
|
||||||
return .sendingFailed(.verifiedUser(.hasUnsignedDevice(devices: devices)))
|
|
||||||
case .verifiedUserChangedIdentity(users: let users):
|
|
||||||
return .sendingFailed(.verifiedUser(.changedIdentity(users: users)))
|
|
||||||
case .crossSigningNotSetup, .sendingFromUnverifiedDevice:
|
|
||||||
return .sendingFailed(.unknown)
|
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
|||||||
+3
-1
@@ -15,7 +15,9 @@ struct EncryptedRoomTimelineItem: EventBasedTimelineItemProtocol, Equatable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
enum UTDCause: Hashable {
|
enum UTDCause: Hashable {
|
||||||
case membership
|
case sentBeforeWeJoined
|
||||||
|
case verificationViolation
|
||||||
|
case insecureDevice
|
||||||
case unknown
|
case unknown
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -157,8 +157,14 @@ struct RoomTimelineItemFactory: RoomTimelineItemFactoryProtocol {
|
|||||||
case .unknown:
|
case .unknown:
|
||||||
encryptionType = .megolmV1AesSha2(sessionID: sessionID, cause: .unknown)
|
encryptionType = .megolmV1AesSha2(sessionID: sessionID, cause: .unknown)
|
||||||
errorLabel = L10n.commonWaitingForDecryptionKey
|
errorLabel = L10n.commonWaitingForDecryptionKey
|
||||||
case .membership:
|
case .verificationViolation:
|
||||||
encryptionType = .megolmV1AesSha2(sessionID: sessionID, cause: .membership)
|
encryptionType = .megolmV1AesSha2(sessionID: sessionID, cause: .verificationViolation)
|
||||||
|
errorLabel = L10n.commonUnableToDecryptVerificationViolation
|
||||||
|
case .unsignedDevice, .unknownDevice:
|
||||||
|
encryptionType = .megolmV1AesSha2(sessionID: sessionID, cause: .insecureDevice)
|
||||||
|
errorLabel = L10n.commonUnableToDecryptInsecureDevice
|
||||||
|
case .sentBeforeWeJoined:
|
||||||
|
encryptionType = .megolmV1AesSha2(sessionID: sessionID, cause: .sentBeforeWeJoined)
|
||||||
errorLabel = L10n.commonUnableToDecryptNoAccess
|
errorLabel = L10n.commonUnableToDecryptNoAccess
|
||||||
}
|
}
|
||||||
case .olmV1Curve25519AesSha2(let senderKey):
|
case .olmV1Curve25519AesSha2(let senderKey):
|
||||||
|
|||||||
+2
-2
@@ -60,7 +60,7 @@ packages:
|
|||||||
# Element/Matrix dependencies
|
# Element/Matrix dependencies
|
||||||
MatrixRustSDK:
|
MatrixRustSDK:
|
||||||
url: https://github.com/element-hq/matrix-rust-components-swift
|
url: https://github.com/element-hq/matrix-rust-components-swift
|
||||||
exactVersion: 1.0.60
|
exactVersion: 1.0.61
|
||||||
# path: ../matrix-rust-sdk
|
# path: ../matrix-rust-sdk
|
||||||
Compound:
|
Compound:
|
||||||
url: https://github.com/element-hq/compound-ios
|
url: https://github.com/element-hq/compound-ios
|
||||||
@@ -68,7 +68,7 @@ packages:
|
|||||||
# path: ../compound-ios
|
# path: ../compound-ios
|
||||||
AnalyticsEvents:
|
AnalyticsEvents:
|
||||||
url: https://github.com/matrix-org/matrix-analytics-events
|
url: https://github.com/matrix-org/matrix-analytics-events
|
||||||
minorVersion: 0.25.0
|
minorVersion: 0.27.0
|
||||||
# path: ../matrix-analytics-events
|
# path: ../matrix-analytics-events
|
||||||
Emojibase:
|
Emojibase:
|
||||||
url: https://github.com/matrix-org/emojibase-bindings
|
url: https://github.com/matrix-org/emojibase-bindings
|
||||||
|
|||||||
Reference in New Issue
Block a user