mobile: simplex links in UI, core: trusted uri for simplex links (#1410)

This commit is contained in:
Evgeny Poberezkin
2022-11-24 17:14:56 +00:00
committed by GitHub
parent a7345ee4d9
commit 4485d46307
13 changed files with 158 additions and 14 deletions

View File

@@ -1713,10 +1713,26 @@ public enum Format: Decodable, Equatable {
case secret
case colored(color: FormatColor)
case uri
// TODO trustedUri: Bool
case simplexLink(linkType: SimplexLinkType, simplexUri: String, smpHosts: [String])
case email
case phone
}
public enum SimplexLinkType: String, Decodable {
case contact
case invitation
case group
public var description: String {
switch self {
case .contact: return NSLocalizedString("SimpleX contact address", comment: "simplex link type")
case .invitation: return NSLocalizedString("SimpleX 1-time invitation", comment: "simplex link type")
case .group: return NSLocalizedString("SimpleX group link", comment: "simplex link type")
}
}
}
public enum FormatColor: String, Decodable {
case red = "red"
case green = "green"