mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-22 09:26:37 +03:00
Fix pin_message not returning Message on PMs
This commit is contained in:
parent
49713b2784
commit
1e6be28e4b
|
@ -1421,12 +1421,11 @@ class MessageMethods:
|
||||||
)
|
)
|
||||||
result = await self(request)
|
result = await self(request)
|
||||||
|
|
||||||
# Unpinning does not produce a service message
|
# Unpinning does not produce a service message.
|
||||||
if unpin:
|
# Pinning a message that was already pinned also produces no service message.
|
||||||
return
|
# Pinning a message in your own chat does not produce a service message,
|
||||||
|
# but pinning on a private conversation with someone else does.
|
||||||
# Pinning in User chats (just with yourself really) does not produce a service message
|
if unpin or not result.updates:
|
||||||
if helpers._entity_type(entity) == helpers._EntityType.USER:
|
|
||||||
return
|
return
|
||||||
|
|
||||||
# Pinning a message that doesn't exist would RPC-error earlier
|
# Pinning a message that doesn't exist would RPC-error earlier
|
||||||
|
|
Loading…
Reference in New Issue
Block a user