Attempt to load and save MessageBox state

This commit is contained in:
Lonami Exo
2022-05-13 17:40:03 +02:00
parent 053a0052c8
commit a5c3df2743
7 changed files with 60 additions and 8 deletions

View File

@@ -215,6 +215,14 @@ class SQLiteSession(MemorySession):
entity_id, state.pts, state.qts,
state.date.timestamp(), state.seq)
async def get_update_states(self):
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)
finally:
c.close()
async def save(self):
"""Saves the current session object as session_user_id.session"""
# This is a no-op if there are no changes to commit, so there's