Show correct displayname in reply to pill

This commit is contained in:
Tulir Asokan
2018-02-10 11:38:34 +02:00
parent 1e6ff3c28f
commit 40178d5917
+4 -2
View File
@@ -254,8 +254,10 @@ def telegram_event_to_matrix(evt, source, native_replies=False, message_link_in_
body = (content["formatted_body"]
if "formatted_body" in content
else content["body"])
reply_to_user = ("<a href='https://matrix.to/#/"
+ f"{event['sender']}'>{event['sender']}</a>")
sender = event['sender']
puppet = p.Puppet.get_by_mxid(sender, create=False)
displayname = puppet.displayname if puppet else sender
reply_to_user = (f"<a href='https://matrix.to/#/{sender}'>{displayname}</a>")
reply_to_msg = (("<a href='https://matrix.to/#/"
+ f"{msg.mx_room}/{msg.mxid}'>Reply</a>")
if message_link_in_reply else "Reply")