[Server] Serve the login message through the database interface (#7854)

This commit is contained in:
BruebachL 2026-11-10 12:16:32 +01:00 • committed by GitHub
parent ec3ad812f0
commit f8f8fffa6b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 35 additions and 18 deletions

View file

@ -3293,6 +3293,23 @@ Server_DatabaseInterface::UptimeSnapshot Servatrice_DatabaseInterface::getLatest
return snapshot;
}
bool Servatrice_DatabaseInterface::getLatestServerMessage(int serverId, QString &message)
{
if (!checkSql()) {
return false;
}
QSqlQuery *query = prepareQuery(
"select message from {prefix}_servermessages where id_server = :id_server order by timest desc limit 1");
query->bindValue(":id_server", serverId);
if (!execSqlQuery(query) || !query->next()) {
return false;
}
message = query->value(0).toString();
return true;
}
bool Servatrice_DatabaseInterface::removeUserAvatar(const QString &userName)
{
if (!checkSql()) {