[Server] Move deck-path and visibility lookups into the database interface

Resolving a deck folder path, reading a deck's owner, and walking its folder chain for public visibility were SQL queries living in the socket handler, keyed to the logged-in user through userInfo. Declare the three lookups on Server_DatabaseInterface, implement them in Servatrice_DatabaseInterface with the user id as an explicit parameter, and let the deck commands ask the injected interface.
This commit is contained in:
Lukas Brübach 2026-11-09 20:53:40 +01:00
parent 447788a3f8
commit 60f47c6b4c
5 changed files with 106 additions and 93 deletions

View file

@ -67,6 +67,7 @@ private:
* backup key is unset or the sealed value does not fit the column. */
QString sealLegacyBackup(const QString &storedName, const QString &credential);
bool isStrictModeEnabled(bool &ok) const;
int getDeckPathIdAt(int basePathId, QStringList path, int userId);
bool addToList(const QString &table, int userId, int targetId);
bool removeFromList(const QString &table, int userId, int targetId);
@ -120,6 +121,9 @@ public:
bool removeFromBuddyList(int userId, int targetId) override;
bool addToIgnoreList(int userId, int targetId) override;
bool removeFromIgnoreList(int userId, int targetId) override;
int getDeckPathId(const QString &path, int userId) override;
int getDeckOwnerId(int deckId) override;
bool isDeckEffectivelyPublic(int deckId) 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;