From a49e2768a3e2fd15f785bac2e7e56e6ca430d32f Mon Sep 17 00:00:00 2001 From: Andrew Ferrazzutti Date: Mon, 9 May 2022 03:22:19 -0400 Subject: [PATCH] Don't send outbound mentions for direct chats because KT doesn't allow them, and errors when the bridge sends them --- matrix_appservice_kakaotalk/formatter/from_matrix.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/matrix_appservice_kakaotalk/formatter/from_matrix.py b/matrix_appservice_kakaotalk/formatter/from_matrix.py index 9976ea6..51ceb83 100644 --- a/matrix_appservice_kakaotalk/formatter/from_matrix.py +++ b/matrix_appservice_kakaotalk/formatter/from_matrix.py @@ -154,7 +154,11 @@ async def matrix_to_kakaotalk( ) else: reply_to = None - if content.get("format", None) == Format.HTML and content["formatted_body"] and content.msgtype.is_text: + if ( + content.get("format", None) == Format.HTML and content["formatted_body"] and + content.msgtype.is_text and + not portal.is_direct + ): parsed = await ToKakaoTalkParser().parse(utf16_surrogate.add(content["formatted_body"])) text = utf16_surrogate.remove(parsed.text) mentions_by_user: dict[Long, MentionStruct] = {}