diff --git a/src/pushprocessor.js b/src/pushprocessor.js index 712c45399..445fce4be 100644 --- a/src/pushprocessor.js +++ b/src/pushprocessor.js @@ -184,7 +184,16 @@ function PushProcessor(client) { }; 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') { return false; }