mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
Incoming session verification support (#3428)
* Fixes #1227 - Add support for receiving and interacting with incoming session verification requests. * Fix a couple of random small warnings * Move static view config to the view state * Update snapshots
This commit is contained in:
+18
-2
@@ -7,8 +7,11 @@
|
||||
|
||||
import Combine
|
||||
import Foundation
|
||||
import MatrixRustSDK
|
||||
|
||||
enum SessionVerificationControllerProxyError: Error {
|
||||
case failedAcknowledgingVerificationRequest
|
||||
case failedAcceptingVerificationRequest
|
||||
case failedRequestingVerification
|
||||
case failedStartingSasVerification
|
||||
case failedApprovingVerification
|
||||
@@ -16,7 +19,8 @@ enum SessionVerificationControllerProxyError: Error {
|
||||
case failedCancellingVerification
|
||||
}
|
||||
|
||||
enum SessionVerificationControllerProxyCallback {
|
||||
enum SessionVerificationControllerProxyAction {
|
||||
case receivedVerificationRequest(details: SessionVerificationRequestDetails)
|
||||
case acceptedVerificationRequest
|
||||
case startedSasVerification
|
||||
case receivedVerificationData([SessionVerificationEmoji])
|
||||
@@ -25,6 +29,14 @@ enum SessionVerificationControllerProxyCallback {
|
||||
case failed
|
||||
}
|
||||
|
||||
struct SessionVerificationRequestDetails {
|
||||
let senderID: String
|
||||
let flowID: String
|
||||
let deviceID: String
|
||||
let displayName: String?
|
||||
let firstSeenDate: Date
|
||||
}
|
||||
|
||||
struct SessionVerificationEmoji: Hashable {
|
||||
let symbol: String
|
||||
let description: String
|
||||
@@ -36,7 +48,11 @@ struct SessionVerificationEmoji: Hashable {
|
||||
|
||||
// sourcery: AutoMockable
|
||||
protocol SessionVerificationControllerProxyProtocol {
|
||||
var callbacks: PassthroughSubject<SessionVerificationControllerProxyCallback, Never> { get }
|
||||
var actions: PassthroughSubject<SessionVerificationControllerProxyAction, Never> { get }
|
||||
|
||||
func acknowledgeVerificationRequest(details: SessionVerificationRequestDetails) async -> Result<Void, SessionVerificationControllerProxyError>
|
||||
|
||||
func acceptVerificationRequest() async -> Result<Void, SessionVerificationControllerProxyError>
|
||||
|
||||
func requestVerification() async -> Result<Void, SessionVerificationControllerProxyError>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user