[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:
BruebachL 2026-11-10 12:16:20 +01:00 • committed by GitHub
parent 90b3013db6
commit 52d8f84ec8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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 */,