diff --git a/src/indexing/EventIndex.ts b/src/indexing/EventIndex.ts index 97688d725a..fbc731e9a9 100644 --- a/src/indexing/EventIndex.ts +++ b/src/indexing/EventIndex.ts @@ -309,8 +309,7 @@ export default class EventIndex extends EventEmitter { } private eventToJson(ev: MatrixEvent): IEventWithRoomId { - const jsonEvent: any = ev.toJSON(); - const e = ev.isEncrypted() ? jsonEvent.decrypted : jsonEvent; + const e = ev.getEffectiveEvent() as any; if (ev.isEncrypted()) { // Let us store some additional data so we can re-verify the event.