Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display a warning when a user's pinned identity changes #3368

Merged
merged 1 commit into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion ElementX.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1035,6 +1035,7 @@
E82E13CC3EB923CCB8F8273C /* TimelineProxy.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9E543072DE58E751F028998 /* TimelineProxy.swift */; };
E84ADFE9696936C18C2424B5 /* SecureBackupScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84A00BB9CD12CF6AC98D5485 /* SecureBackupScreen.swift */; };
E89536FC8C0E4B79E9842A78 /* RoomTimelineControllerProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C0197EAE9D45A662B8847B6 /* RoomTimelineControllerProtocol.swift */; };
E8C65C19F7C40EE545172DD6 /* RoomScreenFooterView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4137900E28201C314C835C11 /* RoomScreenFooterView.swift */; };
E9347F56CF0683208F4D9249 /* RoomNotificationSettingsScreenViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81A9B5225D0881CEFA2CF7C9 /* RoomNotificationSettingsScreenViewModel.swift */; };
E9560744F7B0292E20ECE5F2 /* RoomDetailsScreenViewModelProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63E8A1E8EE094F570573B6E8 /* RoomDetailsScreenViewModelProtocol.swift */; };
E96005321849DBD7C72A28F2 /* UITestsAppCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46C208DA43CE25D13E670F40 /* UITestsAppCoordinator.swift */; };
Expand Down Expand Up @@ -1488,6 +1489,7 @@
406C90AF8C3E98DF5D4E5430 /* ElementCallServiceConstants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ElementCallServiceConstants.swift; sourceTree = "<group>"; };
40B21E611DADDEF00307E7AC /* String.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = String.swift; sourceTree = "<group>"; };
4100DDE6BF3C566AB66B80CC /* MentionSuggestionItemView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MentionSuggestionItemView.swift; sourceTree = "<group>"; };
4137900E28201C314C835C11 /* RoomScreenFooterView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomScreenFooterView.swift; sourceTree = "<group>"; };
4176C3E20C772DE8D182863C /* LegalInformationScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LegalInformationScreen.swift; sourceTree = "<group>"; };
419957D7B1C983D7B3B93678 /* pt-BR */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "pt-BR"; path = "pt-BR.lproj/InfoPlist.strings"; sourceTree = "<group>"; };
41BB37D96C3EA18F3CE8675D /* RoomDirectorySearchScreenModels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoomDirectorySearchScreenModels.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -4018,6 +4020,7 @@
children = (
422724361B6555364C43281E /* RoomHeaderView.swift */,
5221DFDF809142A2D6AC82B9 /* RoomScreen.swift */,
4137900E28201C314C835C11 /* RoomScreenFooterView.swift */,
4552D3466B1453F287223ADA /* SwipeRightAction.swift */,
464C6BFAA853DC755B9C1F60 /* PinnedItemsBanner */,
);
Expand Down Expand Up @@ -6788,6 +6791,7 @@
F8F47CE757EE656905F01F2C /* RoomRolesAndPermissionsScreenViewModelProtocol.swift in Sources */,
C55A44C99F64A479ABA85B46 /* RoomScreen.swift in Sources */,
A851635B3255C6DC07034A12 /* RoomScreenCoordinator.swift in Sources */,
E8C65C19F7C40EE545172DD6 /* RoomScreenFooterView.swift in Sources */,
352C439BE0F75E101EF11FB1 /* RoomScreenModels.swift in Sources */,
7BB31E67648CF32D2AB5E502 /* RoomScreenViewModel.swift in Sources */,
617624A97BDBB75ED3DD8156 /* RoomScreenViewModelProtocol.swift in Sources */,
Expand Down Expand Up @@ -7785,7 +7789,7 @@
repositoryURL = "https://github.com/element-hq/matrix-rust-components-swift";
requirement = {
kind = exactVersion;
version = 1.0.53;
version = 1.0.55;
};
};
701C7BEF8F70F7A83E852DCC /* XCRemoteSwiftPackageReference "GZIP" */ = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/element-hq/matrix-rust-components-swift",
"state" : {
"revision" : "83abbdc8485340c20f27148153ff62f690ca210b",
"version" : "1.0.53"
"revision" : "8ee63edc76bccd12c17a22eaf4eddae69e5f1303",
"version" : "1.0.55"
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@
"common_voice_message" = "Voice message";
"common_waiting" = "Waiting…";
"common_waiting_for_decryption_key" = "Waiting for this message";
"common.copied_to_clipboard" = "Copied to clipboard";
"common.do_not_show_this_again" = "Do not show this again";
"common.open_source_licenses" = "Open source licenses";
"common.pinned" = "Pinned";
Expand All @@ -240,6 +241,7 @@
"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";
"crash_detection_dialog_content" = "%1$@ crashed the last time it was used. Would you like to share a crash report with us?";
"crypto_identity_change_pin_violation" = "%1$@'s identity appears to have changed. %2$@";
"dialog_permission_camera" = "In order to let the application use the camera, please grant the permission in the system settings.";
"dialog_permission_generic" = "Please grant the permission in the system settings.";
"dialog_permission_location_description_ios" = "Grant access in Settings -> Location.";
Expand Down Expand Up @@ -481,7 +483,7 @@
"screen_edit_profile_updating_details" = "Updating profile…";
"screen_encryption_reset_action_continue_reset" = "Continue reset";
"screen_encryption_reset_bullet_1" = "Your account details, contacts, preferences, and chat list will be kept";
"screen_encryption_reset_bullet_2" = "You will lose your existing message history";
"screen_encryption_reset_bullet_2" = "You will lose your existing message history unless it is stored on another device";
"screen_encryption_reset_bullet_3" = "You will need to verify all your existing devices and contacts again";
"screen_encryption_reset_footer" = "Only reset your identity if you don’t have access to another signed-in device and you’ve lost your recovery key.";
"screen_encryption_reset_title" = "Can't confirm? You’ll need to reset your identity.";
Expand Down
2 changes: 2 additions & 0 deletions ElementX/Sources/Application/AppSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ final class AppSettings {
let encryptionURL: URL = "https://element.io/help#encryption"
/// A URL where users can go read more about the chat backup.
let chatBackupDetailsURL: URL = "https://element.io/help#encryption5"
/// A URL where users can go read more about identity pinning violations
let identityPinningViolationDetailsURL: URL = "https://element.io/help#18"
/// Any domains that Element web may be hosted on - used for handling links.
let elementWebHosts = ["app.element.io", "staging.element.io", "develop.element.io"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,8 @@ class RoomFlowCoordinator: FlowCoordinatorProtocol {

let composerDraftService = ComposerDraftService(roomProxy: roomProxy, timelineItemfactory: timelineItemFactory)

let parameters = RoomScreenCoordinatorParameters(roomProxy: roomProxy,
let parameters = RoomScreenCoordinatorParameters(clientProxy: userSession.clientProxy,
roomProxy: roomProxy,
focussedEvent: focussedEvent,
timelineController: timelineController,
mediaProvider: userSession.mediaProvider,
Expand Down
8 changes: 7 additions & 1 deletion ElementX/Sources/Generated/Strings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,10 @@ internal enum L10n {
internal static func crashDetectionDialogContent(_ p1: Any) -> String {
return L10n.tr("Localizable", "crash_detection_dialog_content", String(describing: p1))
}
/// %1$@'s identity appears to have changed. %2$@
internal static func cryptoIdentityChangePinViolation(_ p1: Any, _ p2: Any) -> String {
return L10n.tr("Localizable", "crypto_identity_change_pin_violation", String(describing: p1), String(describing: p2))
}
/// In order to let the application use the camera, please grant the permission in the system settings.
internal static var dialogPermissionCamera: String { return L10n.tr("Localizable", "dialog_permission_camera") }
/// Please grant the permission in the system settings.
Expand Down Expand Up @@ -1119,7 +1123,7 @@ internal enum L10n {
internal static var screenEncryptionResetActionContinueReset: String { return L10n.tr("Localizable", "screen_encryption_reset_action_continue_reset") }
/// Your account details, contacts, preferences, and chat list will be kept
internal static var screenEncryptionResetBullet1: String { return L10n.tr("Localizable", "screen_encryption_reset_bullet_1") }
/// You will lose your existing message history
/// You will lose your existing message history unless it is stored on another device
internal static var screenEncryptionResetBullet2: String { return L10n.tr("Localizable", "screen_encryption_reset_bullet_2") }
/// You will need to verify all your existing devices and contacts again
internal static var screenEncryptionResetBullet3: String { return L10n.tr("Localizable", "screen_encryption_reset_bullet_3") }
Expand Down Expand Up @@ -2410,6 +2414,8 @@ internal enum L10n {
}

internal enum Common {
/// Copied to clipboard
internal static var copiedToClipboard: String { return L10n.tr("Localizable", "common.copied_to_clipboard") }
/// Do not show this again
internal static var doNotShowThisAgain: String { return L10n.tr("Localizable", "common.do_not_show_this_again") }
/// Open source licenses
Expand Down
76 changes: 76 additions & 0 deletions ElementX/Sources/Mocks/Generated/GeneratedMocks.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4426,6 +4426,76 @@ class ClientProxyMock: ClientProxyProtocol {
return curve25519Base64ReturnValue
}
}
//MARK: - pinUserIdentity

var pinUserIdentityUnderlyingCallsCount = 0
var pinUserIdentityCallsCount: Int {
get {
if Thread.isMainThread {
return pinUserIdentityUnderlyingCallsCount
} else {
var returnValue: Int? = nil
DispatchQueue.main.sync {
returnValue = pinUserIdentityUnderlyingCallsCount
}

return returnValue!
}
}
set {
if Thread.isMainThread {
pinUserIdentityUnderlyingCallsCount = newValue
} else {
DispatchQueue.main.sync {
pinUserIdentityUnderlyingCallsCount = newValue
}
}
}
}
var pinUserIdentityCalled: Bool {
return pinUserIdentityCallsCount > 0
}
var pinUserIdentityReceivedUserID: String?
var pinUserIdentityReceivedInvocations: [String] = []

var pinUserIdentityUnderlyingReturnValue: Result<Void, ClientProxyError>!
var pinUserIdentityReturnValue: Result<Void, ClientProxyError>! {
get {
if Thread.isMainThread {
return pinUserIdentityUnderlyingReturnValue
} else {
var returnValue: Result<Void, ClientProxyError>? = nil
DispatchQueue.main.sync {
returnValue = pinUserIdentityUnderlyingReturnValue
}

return returnValue!
}
}
set {
if Thread.isMainThread {
pinUserIdentityUnderlyingReturnValue = newValue
} else {
DispatchQueue.main.sync {
pinUserIdentityUnderlyingReturnValue = newValue
}
}
}
}
var pinUserIdentityClosure: ((String) async -> Result<Void, ClientProxyError>)?

func pinUserIdentity(_ userID: String) async -> Result<Void, ClientProxyError> {
pinUserIdentityCallsCount += 1
pinUserIdentityReceivedUserID = userID
DispatchQueue.main.async {
self.pinUserIdentityReceivedInvocations.append(userID)
}
if let pinUserIdentityClosure = pinUserIdentityClosure {
return await pinUserIdentityClosure(userID)
} else {
return pinUserIdentityReturnValue
}
}
//MARK: - resetIdentity

var resetIdentityUnderlyingCallsCount = 0
Expand Down Expand Up @@ -5791,6 +5861,11 @@ class JoinedRoomProxyMock: JoinedRoomProxyProtocol {
set(value) { underlyingTypingMembersPublisher = value }
}
var underlyingTypingMembersPublisher: CurrentValuePublisher<[String], Never>!
var identityStatusChangesPublisher: CurrentValuePublisher<[IdentityStatusChange], Never> {
get { return underlyingIdentityStatusChangesPublisher }
set(value) { underlyingIdentityStatusChangesPublisher = value }
}
var underlyingIdentityStatusChangesPublisher: CurrentValuePublisher<[IdentityStatusChange], Never>!
var actionsPublisher: AnyPublisher<JoinedRoomProxyAction, Never> {
get { return underlyingActionsPublisher }
set(value) { underlyingActionsPublisher = value }
Expand Down Expand Up @@ -12495,6 +12570,7 @@ class RoomMemberProxyMock: RoomMemberProxyProtocol {
}
var underlyingUserID: String!
var displayName: String?
var disambiguatedDisplayName: String?
var avatarURL: URL?
var membership: MembershipState {
get { return underlyingMembership }
Expand Down
Loading
Loading