Skip to content

Commit f7ce3ab

Browse files
committed
Merge branch 'min'
2 parents 2122a2e + 14a6817 commit f7ce3ab

1 file changed

Lines changed: 20 additions & 1 deletion

File tree

pyrogram/client/client.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ class Client:
122122

123123
INVITE_LINK_RE = re.compile(r"^(?:https?://)?(?:t\.me/joinchat/)?([\w-]+)$")
124124
DIALOGS_AT_ONCE = 100
125-
UPDATES_WORKERS = 2
125+
UPDATES_WORKERS = 1
126126
DOWNLOAD_WORKERS = 1
127127

128128
def __init__(self,
@@ -619,6 +619,25 @@ def updates_worker(self):
619619
) or getattr(update, "channel_id", None)
620620

621621
pts = getattr(update, "pts", None)
622+
pts_count = getattr(update, "pts_count", None)
623+
624+
if isinstance(update, types.UpdateNewChannelMessage):
625+
diff = self.send(
626+
functions.updates.GetChannelDifference(
627+
channel=self.resolve_peer(update.message.to_id.channel_id),
628+
filter=types.ChannelMessagesFilter(
629+
ranges=[types.MessageRange(
630+
min_id=update.message.id,
631+
max_id=update.message.id
632+
)]
633+
),
634+
pts=pts - pts_count,
635+
limit=pts
636+
)
637+
)
638+
639+
updates.users += diff.users
640+
updates.chats += diff.chats
622641

623642
if channel_id and pts:
624643
if channel_id not in self.channels_pts:

0 commit comments

Comments
 (0)