mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-26 03:13:45 +03:00
Make non-fwded messages sent to yourself outgoing
This commit is contained in:
parent
7cfecfaf21
commit
56ddaaee6f
|
@ -91,6 +91,14 @@ class NewMessage(EventBuilder):
|
|||
return
|
||||
|
||||
event._entities = update._entities
|
||||
|
||||
# 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.to_id, types.PeerUser):
|
||||
if ori.from_id == ori.to_id.user_id and not ori.fwd_from:
|
||||
event.message.out = True
|
||||
|
||||
return self._message_filter_event(event)
|
||||
|
||||
def _message_filter_event(self, event):
|
||||
|
|
|
@ -401,6 +401,12 @@ class Message:
|
|||
"""
|
||||
Whether the message is outgoing (i.e. you sent it from
|
||||
another session) or incoming (i.e. someone else sent it).
|
||||
|
||||
Note that messages in your own chat are always incoming,
|
||||
but this property will be ``True`` if you send a message
|
||||
to your own chat. Messages you forward to your chat are
|
||||
*not* considered outgoing, just like official clients
|
||||
display them.
|
||||
"""
|
||||
return self.original_message.out
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user