Write update state to session only if Client.skip_updates = False

This commit is contained in:
KurimuzonAkuma 2024-06-01 00:52:22 +03:00
parent 9a7d2ee0bd
commit ff3d53e142

View File

@ -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(