Stop setting the sender to be the channel when missing

This commit is contained in:
Lonami Exo
2022-01-09 12:20:58 +01:00
parent 010ee0813a
commit 232e76e73a
2 changed files with 4 additions and 7 deletions

View File

@@ -410,13 +410,6 @@ class Message(ChatGetter, SenderGetter):
if isinstance(message, _tl.Message):
if message.from_id is not None:
sender_id = utils.get_peer_id(message.from_id)
if sender_id is None and message.peer_id and not isinstance(message, _tl.MessageEmpty):
# If the message comes from a Channel, let the sender be it
# ...or...
# incoming messages in private conversations no longer have from_id
# (layer 119+), but the sender can only be the chat we're in.
if message.post or (not message.out and isinstance(message.peer_id, _tl.PeerUser)):
sender_id = utils.get_peer_id(message.peer_id)
# Note that these calls would reset the client
ChatGetter.__init__(self, message.peer_id, broadcast=message.post)