From 824f93daa3ed734951c47adf6903c1fc8f6ebebd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Thu, 26 Aug 2021 19:22:34 +0200 Subject: [PATCH] Add wirePushRules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- src/models/event.ts | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/models/event.ts b/src/models/event.ts index 2159c48ee..898f34fe9 100644 --- a/src/models/event.ts +++ b/src/models/event.ts @@ -150,6 +150,7 @@ export interface IDecryptOptions { export class MatrixEvent extends EventEmitter { private pushActions: IActionsObject = null; + private wirePushActions: IActionsObject = null; private _replacingEvent: MatrixEvent = null; private _localRedactionEvent: MatrixEvent = null; private _isCancelled = false; @@ -949,7 +950,16 @@ export class MatrixEvent extends EventEmitter { * @return {?Object} push actions */ public getPushActions(): IActionsObject | null { - return this.pushActions; + return this.pushActions || this.wirePushActions; + } + + /** + * Get the push actions, if known, for this event + * + * @return {?Object} push actions + */ + public getWirePushActions(): IActionsObject | null { + return this.wirePushActions; } /** @@ -958,7 +968,11 @@ export class MatrixEvent extends EventEmitter { * @param {Object} pushActions push actions */ public setPushActions(pushActions: IActionsObject): void { - this.pushActions = pushActions; + if (this._decryptionPromise) { + this.wirePushActions = pushActions; + } else { + this.pushActions = pushActions; + } } /**