Skip to content

Commit

Permalink
feat: add function to get the clear event
Browse files Browse the repository at this point in the history
Signed-off-by: lauti7 <[email protected]>
  • Loading branch information
lauti7 committed Oct 27, 2022
1 parent b447871 commit 2b38345
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/models/event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -906,6 +906,16 @@ export class MatrixEvent extends TypedEventEmitter<MatrixEventEmittedEvents, Mat
return this.clearEvent ? this.clearEvent.content : null;
}

/**
* Gets the clear event. If the event is not encrypted,
* or encryption has not been completed, this will return null.
*
* @returns {Object} The clear event of the encrypted event.
*/
public getClearEvent(): IClearEvent | null {
return this.clearEvent || null
}

/**
* Check if the event is encrypted.
* @return {boolean} True if this event is encrypted.
Expand Down

0 comments on commit 2b38345

Please sign in to comment.