mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-10 03:53:26 -08:00
[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:
parent
28f92ac5f5
commit
8c0e796b0d
5 changed files with 106 additions and 93 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue