Fix patching of message.out for self-chat

This commit is contained in:
Lonami Exo 2020-10-02 10:22:38 +02:00
parent 53920a1568
commit e24c49f5be

View File

@ -138,9 +138,8 @@ class NewMessage(EventBuilder):
# Make messages sent to ourselves outgoing unless they're forwarded.
# This makes it consistent with official client's appearance.
ori = event.message
if isinstance(ori.peer_id, types.PeerUser):
if ori.from_id == ori.peer_id and not ori.fwd_from:
event.message.out = True
if ori.peer_id == types.PeerUser(self_id) and not ori.fwd_from:
event.message.out = True
return event