mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
vector-im/element-x-ios/issues/31 - Implement simple SaS sesson verification
* vector-im/element-x-ios/issues/31 - Session verification unit and UI tests * Fix ImageAnonymizer tests when running on Apple Silicon * Rename SessionVerification to SessionVerificationScreen
This commit is contained in:
+43
@@ -0,0 +1,43 @@
|
||||
//
|
||||
// SessionVerificationControllerProxyProtocol.swift
|
||||
// ElementX
|
||||
//
|
||||
// Created by Stefan Ceriu on 07/06/2022.
|
||||
// Copyright © 2022 Element. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import Combine
|
||||
|
||||
enum SessionVerificationControllerProxyError: Error {
|
||||
case failedRequestingVerification
|
||||
case failedApprovingVerification
|
||||
case failedDecliningVerification
|
||||
case failedCancellingVerification
|
||||
}
|
||||
|
||||
enum SessionVerificationControllerProxyCallback {
|
||||
case receivedVerificationData([SessionVerificationEmoji])
|
||||
case finished
|
||||
case cancelled
|
||||
case failed
|
||||
}
|
||||
|
||||
struct SessionVerificationEmoji: Hashable {
|
||||
let symbol: String
|
||||
let description: String
|
||||
}
|
||||
|
||||
protocol SessionVerificationControllerProxyProtocol {
|
||||
var callbacks: PassthroughSubject<SessionVerificationControllerProxyCallback, Never> { get }
|
||||
|
||||
var isVerified: Bool { get }
|
||||
|
||||
func requestVerification() async -> Result<Void, SessionVerificationControllerProxyError>
|
||||
|
||||
func approveVerification() async -> Result<Void, SessionVerificationControllerProxyError>
|
||||
|
||||
func declineVerification() async -> Result<Void, SessionVerificationControllerProxyError>
|
||||
|
||||
func cancelVerification() async -> Result<Void, SessionVerificationControllerProxyError>
|
||||
}
|
||||
Reference in New Issue
Block a user