[Server] Move deck folder writes into the database interface

Setting a deck or folder public, creating a folder, and deleting a folder tree were SQL statements in the socket handler. Declare them on Server_DatabaseInterface with a DeckStorageResult so the caller can still tell a missing row from a failed write, implement them in Servatrice_DatabaseInterface with the same statements, and let the three folder commands ask the injected interface. Readiness probing keeps its previous ignore-the-result shape.
This commit is contained in:
Lukas Brübach 2026-11-09 21:36:02 +01:00
parent 60f47c6b4c
commit 9d6f36b181
5 changed files with 121 additions and 59 deletions

View file

@ -68,6 +68,7 @@ private:
QString sealLegacyBackup(const QString &storedName, const QString &credential);
bool isStrictModeEnabled(bool &ok) const;
int getDeckPathIdAt(int basePathId, QStringList path, int userId);
void deleteDeckFolderTree(int basePathId);
bool addToList(const QString &table, int userId, int targetId);
bool removeFromList(const QString &table, int userId, int targetId);
@ -124,6 +125,10 @@ public:
int getDeckPathId(const QString &path, int userId) override;
int getDeckOwnerId(int deckId) override;
bool isDeckEffectivelyPublic(int deckId) override;
DeckStorageResult setDeckVisibility(int deckId, int userId, bool isPublic) override;
DeckStorageResult setDeckFolderVisibility(int folderId, int userId, bool isPublic) override;
DeckStorageResult createDeckFolder(int parentId, int userId, const QString &name) override;
void deleteDeckFolder(int folderId) override;
QMap<QString, ServerInfo_User> getBuddyList(const QString &name) override;
QMap<QString, ServerInfo_User> getIgnoreList(const QString &name) override;
bool isInBuddyList(const QString &whoseList, const QString &who) override;