You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-28 05:03:59 +03:00
Use the decrypted event content when checking the push rules
Otherwise we'll be looking at the encrypted source, and that doesn't help anyone.
This commit is contained in:
@@ -184,7 +184,16 @@ function PushProcessor(client) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const eventFulfillsDisplayNameCondition = function(cond, ev) {
|
const eventFulfillsDisplayNameCondition = function(cond, ev) {
|
||||||
const content = ev.getContent();
|
let content = ev.getContent();
|
||||||
|
// TODO: Don't use private variable access
|
||||||
|
if (ev.isEncrypted() && ev._clearEvent) {
|
||||||
|
// Sometimes the event content is nested for some reason, so unpack that.
|
||||||
|
if (ev._clearEvent.content) {
|
||||||
|
content = ev._clearEvent.content;
|
||||||
|
} else {
|
||||||
|
content = ev._clearEvent;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (!content || !content.body || typeof content.body != 'string') {
|
if (!content || !content.body || typeof content.body != 'string') {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user