Don't send outbound mentions for direct chats

because KT doesn't allow them, and errors when the bridge sends them
This commit is contained in:
Andrew Ferrazzutti 2022-05-09 03:22:19 -04:00
parent 128979e06b
commit a49e2768a3

View File

@ -154,7 +154,11 @@ async def matrix_to_kakaotalk(
) )
else: else:
reply_to = None 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"])) parsed = await ToKakaoTalkParser().parse(utf16_surrogate.add(content["formatted_body"]))
text = utf16_surrogate.remove(parsed.text) text = utf16_surrogate.remove(parsed.text)
mentions_by_user: dict[Long, MentionStruct] = {} mentions_by_user: dict[Long, MentionStruct] = {}