Fix two previous commits
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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],
|
||||
|
||||
Reference in New Issue
Block a user