Definition location.hpp:10
std::int_fast64_t Timestamp
Definition event.hpp:18
immer::flex_vector< Event > EventList
Definition types.hpp:107
Definition verification-process.hpp:80
Definition verification-tracker.hpp:53
friend bool operator==(const ProcessCancelled &a, const ProcessCancelled &b)=default
std::string reasonString
Definition verification-tracker.hpp:55
std::string reasonCode
Definition verification-tracker.hpp:54
Definition verification-tracker.hpp:32
friend bool operator==(const ProcessCodeDisplayed &a, const ProcessCodeDisplayed &b)=default
immer::array< int > emojiIndices
The indices of emojis to display.
Definition verification-tracker.hpp:34
immer::array< int > decimalCode
The numbers to display.
Definition verification-tracker.hpp:37
Definition verification-tracker.hpp:48
friend bool operator==(const ProcessDone &a, const ProcessDone &b)=default
Definition verification-tracker.hpp:22
friend bool operator==(const ProcessTheyRequested &a, const ProcessTheyRequested &b)=default
Definition verification-tracker.hpp:43
friend bool operator==(const ProcessVerifiedThem &a, const ProcessVerifiedThem &b)=default
Definition verification-tracker.hpp:27
friend bool operator==(const ProcessWaiting &a, const ProcessWaiting &b)=default
Definition verification-tracker.hpp:69
friend bool operator==(const Process &a, const Process &b)=default
std::string theirDeviceId
Definition verification-tracker.hpp:71
std::string theirUserId
Definition verification-tracker.hpp:70
ProcessState state
Definition verification-tracker.hpp:73
Timestamp requestedTs
Definition verification-tracker.hpp:72
A model that is suitable for displaying to the user.
Definition verification-tracker.hpp:20
std::variant< ProcessTheyRequested, ProcessWaiting, ProcessCodeDisplayed, ProcessVerifiedThem, ProcessDone, ProcessCancelled > ProcessState
Definition verification-tracker.hpp:66
immer::flex_vector< Process > processes
Definition verification-tracker.hpp:77
Definition verification-tracker.hpp:100
std::string toUserId
Definition verification-tracker.hpp:102
Event event
Definition verification-tracker.hpp:101
std::string toDeviceId
Definition verification-tracker.hpp:103
A stateful tracker for all verification processes.
Definition verification-tracker.hpp:98
PendingEvents userConfirmMatch(std::string userId, std::string deviceId)
Confirm an sas match for a process.
Definition verification-tracker.cpp:240
immer::flex_vector< PendingEventDesc > PendingEvents
Definition verification-tracker.hpp:106
void collect(Timestamp now)
Clean up all expired verification processes.
Definition verification-tracker.cpp:264
VerificationTrackerModel model
The model that library user should subscribe to using lager::sensor.
Definition verification-tracker.hpp:119
PendingEvents processIncoming(Timestamp now, EventList toDevice)
Process incoming verification events.
Definition verification-tracker.cpp:85
static bool isVerificationEvent(const Event &e)
Check if the event is an verification event.
Definition verification-tracker.cpp:200
PendingEvents userReady(std::string userId, std::string deviceId)
Mark ourselves ready for a process.
Definition verification-tracker.cpp:216
PendingEvents userCancel(std::string userId, std::string deviceId)
Cancel a verification process.
Definition verification-tracker.cpp:228
VerificationUtils::DeviceIdentity identity
Definition verification-tracker.hpp:108
PendingEvents requestOutgoingToDevice(VerificationUtils::DeviceIdentity theirIdentity, Timestamp now)
Request an outgoing verification for a device using to-device message.
Definition verification-tracker.cpp:41
void setTheirIdentity(VerificationUtils::DeviceIdentity theirId)
Set the key(s) for the other party in a process.
Definition verification-tracker.cpp:206
std::unordered_map< std::string, std::unordered_map< std::string, VerificationProcess > > processes
Definition verification-tracker.hpp:115
PendingEvents userDenyMatch(std::string userId, std::string deviceId)
Deny an sas match for a process.
Definition verification-tracker.cpp:252
Definition verification-utils.hpp:28