Skip to content

Commit

Permalink
Add helper method to get formatted body
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Nov 7, 2020
1 parent cf79ae0 commit 68dfd6b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions mautrix/types/event/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,11 @@ def set_reply(self, reply_to: Union['MessageEvent', EventID],
+ self.formatted_body)
self.body = reply_to.make_reply_fallback_text(displayname) + self.body

def formatted(self, format: Format) -> Optional[str]:
if self.format == format:
return self.formatted_body
return None

def trim_reply_fallback(self) -> None:
if self.get_reply_to():
self._trim_reply_fallback_text()
Expand Down

0 comments on commit 68dfd6b

Please sign in to comment.