1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-25 05:23:13 +03:00

Add wirePushRules

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner
2021-08-26 19:22:34 +02:00
parent 9fec2f8c58
commit 824f93daa3

View File

@@ -150,6 +150,7 @@ export interface IDecryptOptions {
export class MatrixEvent extends EventEmitter { export class MatrixEvent extends EventEmitter {
private pushActions: IActionsObject = null; private pushActions: IActionsObject = null;
private wirePushActions: IActionsObject = null;
private _replacingEvent: MatrixEvent = null; private _replacingEvent: MatrixEvent = null;
private _localRedactionEvent: MatrixEvent = null; private _localRedactionEvent: MatrixEvent = null;
private _isCancelled = false; private _isCancelled = false;
@@ -949,7 +950,16 @@ export class MatrixEvent extends EventEmitter {
* @return {?Object} push actions * @return {?Object} push actions
*/ */
public getPushActions(): IActionsObject | null { 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,8 +968,12 @@ export class MatrixEvent extends EventEmitter {
* @param {Object} pushActions push actions * @param {Object} pushActions push actions
*/ */
public setPushActions(pushActions: IActionsObject): void { public setPushActions(pushActions: IActionsObject): void {
if (this._decryptionPromise) {
this.wirePushActions = pushActions;
} else {
this.pushActions = pushActions; this.pushActions = pushActions;
} }
}
/** /**
* Replace the `event` property and recalculate any properties based on it. * Replace the `event` property and recalculate any properties based on it.