MAX: Рефактор папок

This commit is contained in:
Alexey Polyakov
2026-04-24 20:54:28 +03:00
parent 56133416e3
commit 227f90c3c3
6 changed files with 60 additions and 33 deletions

View File

@@ -403,17 +403,26 @@ class AuthProcessors(BaseProcessor):
await cursor.execute(
"""
INSERT INTO user_data
(phone, folders, user_config, chat_config)
VALUES (%s, %s, %s, %s)
(phone, user_config, chat_config)
VALUES (%s, %s, %s)
""",
(
phone,
json.dumps(self.static.USER_FOLDERS),
json.dumps(self.static.USER_SETTINGS),
json.dumps({}),
),
)
# Добавляем дефолтную папку
await cursor.execute(
"""
INSERT INTO user_folders
(id, phone, title, sort_order)
VALUES ('all.chat.folder', %s, 'Все', 0)
""",
(phone,),
)
# Удаляем токен
await cursor.execute(
"DELETE FROM auth_tokens WHERE token_hash = %s", (hashed_token,)