mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-05 03:22:29 +00:00
Fix initial session state load
This commit is contained in:
@@ -219,7 +219,13 @@ class SQLiteSession(MemorySession):
|
||||
c = self._cursor()
|
||||
try:
|
||||
rows = c.execute('select id, pts, qts, date, seq from update_state').fetchall()
|
||||
return ((row[0], types.updates.State(*row[1:], unread_count=0)) for row in rows)
|
||||
return ((row[0], types.updates.State(
|
||||
pts=row[1],
|
||||
qts=row[2],
|
||||
date=datetime.datetime.fromtimestamp(row[3], tz=datetime.timezone.utc),
|
||||
seq=row[4],
|
||||
unread_count=0)
|
||||
) for row in rows)
|
||||
finally:
|
||||
c.close()
|
||||
|
||||
|
Reference in New Issue
Block a user