Fix two previous commits

This commit is contained in:
Tulir Asokan
2018-02-06 14:23:06 +02:00
parent 9145ebdc64
commit ff703c2827
2 changed files with 4 additions and 3 deletions
+2 -1
View File
@@ -218,7 +218,8 @@ def telegram_event_to_matrix(evt, source):
+ f"<blockquote>{html}</blockquote>")
if evt.reply_to_msg_id:
msg = DBMessage.query.get((evt.reply_to_msg_id, source.tgid))
space = evt.to_id.channel_id if isinstance(evt, Message) and isinstance(evt.to_id, PeerChannel) else source.tgid
msg = DBMessage.query.get((evt.reply_to_msg_id, space))
if msg:
quote = f"<a href=\"https://matrix.to/#/{msg.mx_room}/{msg.mxid}\">Quote<br></a>"
if html:
+2 -2
View File
@@ -90,10 +90,10 @@ class Portal:
# to deduplicate based on a hash of the message content.
# The timestamp is only accurate to the second, so we can't rely on solely that either.
hash_content = [str(event.date.timestamp()), event.from_id, event.message]
hash_content = [event.date.timestamp(), event.message]
if event.fwd_from:
hash_content += [event.fwd_from.from_id, event.fwd_from.channel_id]
elif event.media:
elif isinstance(event, Message) and event.media:
try:
hash_content += {
MessageMediaContact: lambda media: [media.user_id],