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

Expose the clear event content directly from an event

This commit is contained in:
Travis Ralston
2019-03-05 14:04:51 -07:00
parent 37f106d4af
commit 2f2deb5333
2 changed files with 13 additions and 8 deletions

View File

@@ -185,14 +185,8 @@ function PushProcessor(client) {
const eventFulfillsDisplayNameCondition = function(cond, ev) {
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 (ev.isEncrypted() && ev.getClearContent()) {
content = ev.getClearContent();
}
if (!content || !content.body || typeof content.body != 'string') {
return false;