2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-08-28 12:57:52 +00:00

Handle minified channel updates

This commit is contained in:
Dan 2018-03-19 01:08:34 +01:00
parent 5b5fb6cbec
commit c4142753d0

View File

@ -616,6 +616,28 @@ class Client:
) or getattr(update, "channel_id", None)
pts = getattr(update, "pts", None)
pts_count = getattr(update, "pts_count", None)
if isinstance(update, types.UpdateNewChannelMessage):
diff = self.send(
functions.updates.GetChannelDifference(
channel=self.resolve_peer(update.message.to_id.channel_id),
filter=types.ChannelMessagesFilter(
ranges=[types.MessageRange(
min_id=update.message.id,
max_id=update.message.id
)]
),
pts=pts - pts_count,
limit=pts
)
)
self.fetch_peers(diff.users)
self.fetch_peers(diff.chats)
updates.users += diff.users
updates.chats += diff.chats
if channel_id and pts:
if channel_id not in self.channels_pts: