From 38e57d2ff98430057764c13c1aa20a8ecf2f6901 Mon Sep 17 00:00:00 2001 From: miruka Date: Mon, 23 Mar 2020 14:23:32 -0400 Subject: [PATCH] Color user mentions in local echoes too --- TODO.md | 4 +--- src/backend/matrix_client.py | 6 +++++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/TODO.md b/TODO.md index 736d505e..610cdfe0 100644 --- a/TODO.md +++ b/TODO.md @@ -1,8 +1,6 @@ # TODO -- mention color in local echo - -## Main goals for next version +## Goals before 0.5.0 - Redacting messages - Download progress bar for file events, "Save as..." diff --git a/src/backend/matrix_client.py b/src/backend/matrix_client.py index b360003a..1f2ec118 100644 --- a/src/backend/matrix_client.py +++ b/src/backend/matrix_client.py @@ -337,7 +337,11 @@ class MatrixClient(nio.AsyncClient): tx_id = uuid4() content[f"{__app_name__}.transaction_id"] = str(tx_id) - await self._local_echo(room_id, tx_id, event_type, content=echo_body) + mentions = HTML.mentions_in_html(echo_body) + await self._local_echo( + room_id, tx_id, event_type, content=echo_body, mentions=mentions, + ) + await self._send_message(room_id, content)