[Server] Move deck file writes into the database interface (#7834)

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:
BruebachL 2026-11-10 12:16:23 +01:00 • committed by GitHub
parent 23781af1f0
commit 7734a94f83
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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;