mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-05 11:58:32 +00:00
Add specific UX for Expected UTDs due to membership (#2740)
* Add specific UX for Expected UTDs due to membership * Update analytics package and snapshots. * Add changelog
This commit is contained in:
@@ -139,7 +139,17 @@ extension AnalyticsService {
|
||||
/// Can be found in `UnableToDecryptInfo`. In case the `UnableToDecryptInfo` contains the value as nil, pass it as `-1`
|
||||
func trackError(context: String?, domain: AnalyticsEvent.Error.Domain, name: AnalyticsEvent.Error.Name, timeToDecryptMillis: Int? = nil) {
|
||||
// CryptoModule is deprecated
|
||||
capture(event: AnalyticsEvent.Error(context: context, cryptoModule: nil, cryptoSDK: .Rust, domain: domain, name: name, timeToDecryptMillis: timeToDecryptMillis))
|
||||
capture(event: AnalyticsEvent.Error(context: context,
|
||||
cryptoModule: .Rust,
|
||||
cryptoSDK: .Rust,
|
||||
domain: domain,
|
||||
eventLocalAgeMillis: nil,
|
||||
isFederated: nil,
|
||||
isMatrixDotOrg: nil,
|
||||
name: name,
|
||||
timeToDecryptMillis: timeToDecryptMillis,
|
||||
userTrustsOwnIdentity: nil,
|
||||
wasVisibleToUser: nil))
|
||||
}
|
||||
|
||||
/// Track the creation of a room
|
||||
|
||||
@@ -161,13 +161,17 @@ struct RoomTimelineItemFactory: RoomTimelineItemFactoryProtocol {
|
||||
_ encryptedMessage: EncryptedMessage,
|
||||
_ isOutgoing: Bool) -> RoomTimelineItemProtocol {
|
||||
var encryptionType = EncryptedRoomTimelineItem.EncryptionType.unknown
|
||||
var errorLabel = L10n.commonWaitingForDecryptionKey
|
||||
switch encryptedMessage {
|
||||
case .megolmV1AesSha2(let sessionID, let cause):
|
||||
let cause: EncryptedRoomTimelineItem.UTDCause = switch cause {
|
||||
case .unknown: .unknown
|
||||
case .membership: .membership
|
||||
switch cause {
|
||||
case .unknown:
|
||||
encryptionType = .megolmV1AesSha2(sessionID: sessionID, cause: .unknown)
|
||||
errorLabel = L10n.commonWaitingForDecryptionKey
|
||||
case .membership:
|
||||
encryptionType = .megolmV1AesSha2(sessionID: sessionID, cause: .membership)
|
||||
errorLabel = L10n.commonUnableToDecryptNoAccess
|
||||
}
|
||||
encryptionType = .megolmV1AesSha2(sessionID: sessionID, cause: cause)
|
||||
case .olmV1Curve25519AesSha2(let senderKey):
|
||||
encryptionType = .olmV1Curve25519AesSha2(senderKey: senderKey)
|
||||
case .unknown:
|
||||
@@ -175,7 +179,7 @@ struct RoomTimelineItemFactory: RoomTimelineItemFactoryProtocol {
|
||||
}
|
||||
|
||||
return EncryptedRoomTimelineItem(id: eventItemProxy.id,
|
||||
body: L10n.commonWaitingForDecryptionKey,
|
||||
body: errorLabel,
|
||||
encryptionType: encryptionType,
|
||||
timestamp: eventItemProxy.timestamp.formatted(date: .omitted, time: .shortened),
|
||||
isOutgoing: isOutgoing,
|
||||
|
||||
Reference in New Issue
Block a user