Notifications: properly italicize emote messages

This commit is contained in:
miruka 2020-09-16 11:41:39 -04:00
parent dcc3473ecf
commit 21ccf90d23

View File

@ -2141,16 +2141,16 @@ class MatrixClient(nio.AsyncClient):
room_name = room.display_name room_name = room.display_name
sender = item.sender_name or item.sender_id sender = item.sender_name or item.sender_id
if len(members) == 2 and room_name == sender: if isinstance(ev, nio.RoomMessageEmote):
body_start = "" body = f"<i>{sender} {item.inline_content}</i>"
elif isinstance(ev, nio.RoomMessageEmote): elif len(members) == 2 and room_name == sender:
body_start = f"<i>{sender} </i>" body = item.inline_content
else: else:
body_start = f"{sender}: " body = f"{sender}: {item.inline_content}"
NotificationRequested( NotificationRequested(
title = room_name, title = room_name,
body = f"{body_start}{item.inline_content}", body = body,
high_importance = highlight, high_importance = highlight,
# image = await self.backend.media_cache.get_thumbnail( # image = await self.backend.media_cache.get_thumbnail(
# item.sender_avatar, 32, 32, # item.sender_avatar, 32, 32,