Fix two previous commits
This commit is contained in:
@@ -218,7 +218,8 @@ def telegram_event_to_matrix(evt, source):
|
|||||||
+ f"<blockquote>{html}</blockquote>")
|
+ f"<blockquote>{html}</blockquote>")
|
||||||
|
|
||||||
if evt.reply_to_msg_id:
|
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:
|
if msg:
|
||||||
quote = f"<a href=\"https://matrix.to/#/{msg.mx_room}/{msg.mxid}\">Quote<br></a>"
|
quote = f"<a href=\"https://matrix.to/#/{msg.mx_room}/{msg.mxid}\">Quote<br></a>"
|
||||||
if html:
|
if html:
|
||||||
|
|||||||
@@ -90,10 +90,10 @@ class Portal:
|
|||||||
# to deduplicate based on a hash of the message content.
|
# 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.
|
# 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:
|
if event.fwd_from:
|
||||||
hash_content += [event.fwd_from.from_id, event.fwd_from.channel_id]
|
hash_content += [event.fwd_from.from_id, event.fwd_from.channel_id]
|
||||||
elif event.media:
|
elif isinstance(event, Message) and event.media:
|
||||||
try:
|
try:
|
||||||
hash_content += {
|
hash_content += {
|
||||||
MessageMediaContact: lambda media: [media.user_id],
|
MessageMediaContact: lambda media: [media.user_id],
|
||||||
|
|||||||
Reference in New Issue
Block a user