mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Add Encryption Authenticity explanations. (#3116)
This commit is contained in:
+21
-1
@@ -14,8 +14,9 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import Compound
|
||||
import MatrixRustSDK
|
||||
import SwiftUI
|
||||
|
||||
/// Represents and issue with a timeline item's authenticity such as coming from an
|
||||
/// unsigned session or being sent unencrypted in an encrypted room. See Rust's
|
||||
@@ -43,6 +44,25 @@ enum EncryptionAuthenticity: Hashable {
|
||||
L10n.eventShieldReasonSentInClear
|
||||
}
|
||||
}
|
||||
|
||||
var color: Color {
|
||||
switch self {
|
||||
case .notGuaranteed(let color),
|
||||
.unknownDevice(let color),
|
||||
.unsignedDevice(let color),
|
||||
.unverifiedIdentity(let color),
|
||||
.sentInClear(let color):
|
||||
color
|
||||
}
|
||||
}
|
||||
|
||||
var icon: KeyPath<CompoundIcons, Image> {
|
||||
// TODO: Should sentInClear have a dedicated icon???
|
||||
switch color {
|
||||
case .red: \.error
|
||||
case .gray: \.info
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension EncryptionAuthenticity {
|
||||
|
||||
Reference in New Issue
Block a user