Fix from_id/sender_id value on message updates

This commit is contained in:
Lonami Exo
2020-10-01 21:22:27 +02:00
parent 572229e536
commit 5c93ea8019
2 changed files with 14 additions and 16 deletions

View File

@@ -107,9 +107,7 @@ class NewMessage(EventBuilder):
media_unread=update.media_unread,
silent=update.silent,
id=update.id,
# Note that peer_id/from_id complement each other in private
# messages, depending on whether the message was outgoing.
peer_id=types.PeerUser(update.user_id if update.out else self_id),
peer_id=types.PeerUser(update.user_id),
from_id=types.PeerUser(self_id if update.out else update.user_id),
message=update.message,
date=update.date,
@@ -125,7 +123,7 @@ class NewMessage(EventBuilder):
media_unread=update.media_unread,
silent=update.silent,
id=update.id,
from_id=types.PeerUser(update.from_id),
from_id=types.PeerUser(self_id if update.out else update.from_id),
peer_id=types.PeerChat(update.chat_id),
message=update.message,
date=update.date,