diff --git a/src/models/event.ts b/src/models/event.ts index 9050f4440..922490363 100644 --- a/src/models/event.ts +++ b/src/models/event.ts @@ -262,6 +262,15 @@ export class MatrixEvent extends EventEmitter { this.localTimestamp = Date.now() - this.getAge(); } + /** + * Gets the clear event as it would be received over the wire. If the event + * is not encrypted, this simply returns the event as-is. + * @returns {Partial} The clear event, as known by the SDK. + */ + public getClearEvent(): Partial { + return this.clearEvent ?? this.event; + } + /** * Get the event_id for this event. * @return {string} The event ID, e.g. $143350589368169JsLZx:localhost