mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-10 03:53:26 -08:00
[Server] Move buddy and ignore list writes into the database interface (#7827)
cmdAddToList/cmdRemoveFromList issued raw SQL against the buddy and ignore tables and looked accounts up through getUserIdInDB, a method that only exists on the MySQL implementation. Add getUserId plus add/remove operations to Server_DatabaseInterface, implement them in Servatrice_DatabaseInterface over the shared single-row helpers, and let the handler ask the injected interface instead of the concrete class.
This commit is contained in:
parent
90b3013db6
commit
52d8f84ec8
4 changed files with 77 additions and 12 deletions
|
|
@ -77,6 +77,27 @@ public:
|
|||
{
|
||||
return false;
|
||||
}
|
||||
/** @brief Numeric id of an existing account, or a negative value when absent. */
|
||||
virtual int getUserId(const QString & /* userName */)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
virtual bool addToBuddyList(int /* userId */, int /* targetId */)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
virtual bool removeFromBuddyList(int /* userId */, int /* targetId */)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
virtual bool addToIgnoreList(int /* userId */, int /* targetId */)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
virtual bool removeFromIgnoreList(int /* userId */, int /* targetId */)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
virtual ServerInfo_User getUserData(const QString &name, bool withId = false) = 0;
|
||||
virtual void storeGameInformation(const QString & /* roomName */,
|
||||
const QStringList & /* roomGameTypes */,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue