Notifications: process non-message events text

This commit is contained in:
miruka 2020-09-16 19:27:36 -04:00
parent 94a623f677
commit 4cd562e02f

View File

@ -2218,6 +2218,12 @@ class MatrixClient(nio.AsyncClient):
if isinstance(ev, nio.RoomMessageEmote): if isinstance(ev, nio.RoomMessageEmote):
body = f"<i>{sender} {item.inline_content}</i>" body = f"<i>{sender} {item.inline_content}</i>"
elif not isinstance(ev, nio.RoomMessage):
body = item.inline_content.replace(
"%1", item.sender_name or item.sender_id,
).replace(
"%2", item.target_name or item.target_id,
)
elif len(members) == 2 and room_name == sender: elif len(members) == 2 and room_name == sender:
body = item.inline_content body = item.inline_content
else: else: