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

Expose MatrixEvent's internal clearEvent as a function

This commit is contained in:
Travis Ralston
2021-07-13 23:09:37 -06:00
parent aed861036b
commit 83337eee57

View File

@@ -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<IEvent>} The clear event, as known by the SDK.
*/
public getClearEvent(): Partial<IEvent> {
return this.clearEvent ?? this.event;
}
/**
* Get the event_id for this event.
* @return {string} The event ID, e.g. <code>$143350589368169JsLZx:localhost