mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-07-15 18:42:23 +03:00
Include service messages for new pins in ChatAction again
This commit is contained in:
parent
23fc38f7c9
commit
2439404ad1
|
@ -31,12 +31,15 @@ class ChatAction(EventBuilder):
|
||||||
"""
|
"""
|
||||||
@classmethod
|
@classmethod
|
||||||
def build(cls, update, others=None, self_id=None):
|
def build(cls, update, others=None, self_id=None):
|
||||||
if isinstance(update, types.UpdatePinnedChannelMessages):
|
# Rely on specific pin updates for unpins, but otherwise ignore them
|
||||||
|
# for new pins (we'd rather handle the new service message with pin,
|
||||||
|
# so that we can act on that message').
|
||||||
|
if isinstance(update, types.UpdatePinnedChannelMessages) and not update.pinned:
|
||||||
return cls.Event(types.PeerChannel(update.channel_id),
|
return cls.Event(types.PeerChannel(update.channel_id),
|
||||||
pin_ids=update.messages,
|
pin_ids=update.messages,
|
||||||
pin=update.pinned)
|
pin=update.pinned)
|
||||||
|
|
||||||
elif isinstance(update, types.UpdatePinnedMessages):
|
elif isinstance(update, types.UpdatePinnedMessages) and not update.pinned:
|
||||||
return cls.Event(update.peer,
|
return cls.Event(update.peer,
|
||||||
pin_ids=update.messages,
|
pin_ids=update.messages,
|
||||||
pin=update.pinned)
|
pin=update.pinned)
|
||||||
|
@ -107,8 +110,9 @@ class ChatAction(EventBuilder):
|
||||||
return cls.Event(msg,
|
return cls.Event(msg,
|
||||||
users=msg.from_id,
|
users=msg.from_id,
|
||||||
new_photo=True)
|
new_photo=True)
|
||||||
# Handled by specific updates
|
elif isinstance(action, types.MessageActionPinMessage) and msg.reply_to:
|
||||||
# elif isinstance(action, types.MessageActionPinMessage) and msg.reply_to:
|
return cls.Event(msg,
|
||||||
|
pin_ids=[msg.reply_to_msg_id])
|
||||||
|
|
||||||
class Event(EventCommon):
|
class Event(EventCommon):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
# Versions should comply with PEP440.
|
# Versions should comply with PEP440.
|
||||||
# This line is parsed in setup.py:
|
# This line is parsed in setup.py:
|
||||||
__version__ = '1.18.1'
|
__version__ = '1.18.2'
|
||||||
|
|
Loading…
Reference in New Issue
Block a user