From 21ccf90d239e60feb1da20e1969602ba94e4140f Mon Sep 17 00:00:00 2001 From: miruka Date: Wed, 16 Sep 2020 11:41:39 -0400 Subject: [PATCH] Notifications: properly italicize emote messages --- src/backend/matrix_client.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/backend/matrix_client.py b/src/backend/matrix_client.py index 534f805a..d32cadb8 100644 --- a/src/backend/matrix_client.py +++ b/src/backend/matrix_client.py @@ -2141,16 +2141,16 @@ class MatrixClient(nio.AsyncClient): room_name = room.display_name sender = item.sender_name or item.sender_id - if len(members) == 2 and room_name == sender: - body_start = "" - elif isinstance(ev, nio.RoomMessageEmote): - body_start = f"{sender} " + if isinstance(ev, nio.RoomMessageEmote): + body = f"{sender} {item.inline_content}" + elif len(members) == 2 and room_name == sender: + body = item.inline_content else: - body_start = f"{sender}: " + body = f"{sender}: {item.inline_content}" NotificationRequested( title = room_name, - body = f"{body_start}{item.inline_content}", + body = body, high_importance = highlight, # image = await self.backend.media_cache.get_thumbnail( # item.sender_avatar, 32, 32,