Merge pull request #3661 from matrix-org/bwindels/verif-toasts

Show incoming verification requests in in-app notifications
This commit is contained in:
Bruno Windels 2019-11-22 16:39:18 +00:00 committed by GitHub
commit 4a684d01a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 424 additions and 29 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() {