[Server] Move deck file writes into the database interface

Deleting a deck, inserting an uploaded deck, and updating one in place were SQL statements in the socket handler, including the dynamic is_public clause and the follow-up visibility read. Add DeckFileData and DeckFileWriteResult to Server_DatabaseInterface with create/update/delete operations, implement them in Servatrice_DatabaseInterface with the same statements and bind order, and let cmdDeckUpload and cmdDeckDel ask the injected interface.
This commit is contained in:
Lukas Brübach 2026-11-09 21:43:03 +01:00
parent 9d6f36b181
commit f5b1bca480
4 changed files with 157 additions and 79 deletions

View file

@ -129,6 +129,10 @@ public:
DeckStorageResult setDeckFolderVisibility(int folderId, int userId, bool isPublic) override;
DeckStorageResult createDeckFolder(int parentId, int userId, const QString &name) override;
void deleteDeckFolder(int folderId) override;
DeckFileWriteResult createDeckFile(int folderId, int userId, const DeckFileData &data) override;
DeckFileWriteResult
updateDeckFile(int deckId, int userId, const DeckFileData &data, bool updateVisibility) override;
DeckStorageResult deleteDeckFile(int deckId, int userId) 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;