1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-08-19 16:42:09 +03:00

Port over push rule eveluator from the angular SDK and make it available on MatrixEvent

This commit is contained in:
David Baker
2015-06-29 15:53:23 +01:00
parent 21150e7587
commit 1be02a3c3c
3 changed files with 227 additions and 0 deletions

View File

@@ -1,3 +1,5 @@
var PushProcessor = require('../pushprocessor');
"use strict";
/**
* This is an internal module. See {@link MatrixEvent} and {@link RoomEvent} for
@@ -142,5 +144,13 @@ module.exports.MatrixEvent.prototype = {
*/
isState: function() {
return this.event.state_key !== undefined;
},
getPushActions(client) {
if (this.pushActions === undefined) {
var pushProcessor = new PushProcessor(client);
this.pushActions = pushProcessor.actionsForEvent(this.event);
}
return this.pushActions;
}
};