1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-29 16:43:09 +03:00

Support flushing the cache on calculated push rules

Needed for encrypted events to be able to pass some push rules.
This commit is contained in:
Travis Ralston
2019-03-04 21:23:55 -07:00
parent 236397816d
commit 998d9e010e

View File

@@ -2299,10 +2299,11 @@ function _membershipChange(client, roomId, userId, membership, reason, callback)
* Obtain a dict of actions which should be performed for this event according
* to the push rules for this user. Caches the dict on the event.
* @param {MatrixEvent} event The event to get push actions for.
* @param {boolean} ignoreCache True to skip the cache and recalculate the push rules.
* @return {module:pushprocessor~PushAction} A dict of actions to perform.
*/
MatrixClient.prototype.getPushActionsForEvent = function(event) {
if (!event.getPushActions()) {
MatrixClient.prototype.getPushActionsForEvent = function(event, ignoreCache = false) {
if (!event.getPushActions() || ignoreCache) {
event.setPushActions(this._pushProcessor.actionsForEvent(event));
}
return event.getPushActions();