add toast for verification requests

this uses a verification requests as emitted by the js-sdk with
the `crypto.verification.request` rather than a verifier as emitted
by `crypto.verification.start` as this works for both to_device and
timeline events with the changes made in the js-sdk pr.
This commit is contained in:
Bruno Windels 2019-11-22 16:00:39 +01:00
parent f1c62e7dab
commit c705752317
3 changed files with 139 additions and 1 deletions

View file

@ -30,6 +30,18 @@ export default class KeyVerificationStateObserver {
this._updateVerificationState();
}
get concluded() {
return this.accepted || this.done || this.cancelled;
}
get pending() {
return !this.concluded;
}
setCallback(callback) {
this._updateCallback = callback;
}
attach() {
this._requestEvent.on("Event.relationsCreated", this._onRelationsCreated);
for (const phaseName of SUB_EVENT_TYPES_OF_INTEREST) {
@ -83,7 +95,7 @@ export default class KeyVerificationStateObserver {
_onRelationsUpdated = (event) => {
this._updateVerificationState();
this._updateCallback();
this._updateCallback && this._updateCallback();
};
_updateVerificationState() {