[Server] Move buddy and ignore list writes into the database interface

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:
Lukas Brübach 2026-11-09 17:26:07 +01:00
parent 9677c953a0
commit f825903a21
4 changed files with 77 additions and 12 deletions

View file

@ -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 */,