fix sender name in replies, misc

This commit is contained in:
git-bruh 2020-12-24 15:41:35 +05:30
parent b69eaff11d
commit 89de9aba4a
No known key found for this signature in database
GPG key ID: E1475C50075ADCE6

View file

@ -82,8 +82,7 @@ class MatrixClient(nio.AsyncClient):
reply_event = await self.room_get_event(
room_id, reply_id
)
reply_event = reply_event.event.source["content"]["body"]
reply_event = reply_event.event
content["m.relates_to"] = {
"m.in_reply_to": {"event_id": reply_id},
@ -93,8 +92,8 @@ class MatrixClient(nio.AsyncClient):
content["formatted_body"] = f"""<mx-reply><blockquote>
<a href="https://matrix.to/#/{room_id}/{reply_id}">In reply to</a>
<a href="https://matrix.to/#/{config["username"]}">{config["username"]}</a><br>
{reply_event}</blockquote></mx-reply>{message}"""
<a href="https://matrix.to/#/{reply_event.sender}">{reply_event.sender}</a><br>
{reply_event.body}</blockquote></mx-reply>{message}"""
if edit_id:
content["body"] = f" * {message}"
@ -202,6 +201,7 @@ class DiscordClient(discord.Client):
content = await self.process_message(after)
if before.id in message_store:
await self.matrix_client.message_send(
content[0], after.channel.id, edit_id=message_store[before.id]
)