mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-11-27 08:36:27 +00:00
Write update state to session only if Client.skip_updates = False
This commit is contained in:
parent
9a7d2ee0bd
commit
ff3d53e142
@ -610,7 +610,7 @@ class Client(Methods):
|
||||
pts = getattr(update, "pts", None)
|
||||
pts_count = getattr(update, "pts_count", None)
|
||||
|
||||
if pts:
|
||||
if pts and not self.skip_updates:
|
||||
await self.storage.update_state(
|
||||
(
|
||||
utils.get_channel_id(channel_id) if channel_id else 0,
|
||||
@ -651,15 +651,16 @@ class Client(Methods):
|
||||
|
||||
self.dispatcher.updates_queue.put_nowait((update, users, chats))
|
||||
elif isinstance(updates, (raw.types.UpdateShortMessage, raw.types.UpdateShortChatMessage)):
|
||||
await self.storage.update_state(
|
||||
(
|
||||
0,
|
||||
updates.pts,
|
||||
None,
|
||||
updates.date,
|
||||
None
|
||||
if not self.skip_updates:
|
||||
await self.storage.update_state(
|
||||
(
|
||||
0,
|
||||
updates.pts,
|
||||
None,
|
||||
updates.date,
|
||||
None
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
diff = await self.invoke(
|
||||
raw.functions.updates.GetDifference(
|
||||
|
Loading…
Reference in New Issue
Block a user