[Server] Move deck-path and visibility lookups into the database interface (#7832)

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:
BruebachL 2026-11-10 12:16:22 +01:00 • committed by GitHub
parent 28f92ac5f5
commit 8c0e796b0d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 106 additions and 93 deletions

View file

@ -180,6 +180,21 @@ public:
{
return 0;
}
/** @brief Id of the folder at a "/"-separated path for one user, 0 for the root, -1 when absent. */
virtual int getDeckPathId(const QString & /* path */, int /* userId */)
{
return -1;
}
/** @brief Owner of a deck file, or -1 when the deck does not exist. */
virtual int getDeckOwnerId(int /* deckId */)
{
return -1;
}
/** @brief Whether a deck is public itself or sits in a public folder. */
virtual bool isDeckEffectivelyPublic(int /* deckId */)
{
return false;
}
virtual bool removeForgotPassword(const QString & /* user */)
{
return false;