[Server] Expose chat-log reads on the database interface (#7830)

getMessageLogHistory, getPrivateChatHistory, and getUserIdInDB were reachable only through Servatrice_DatabaseInterface, so the two log-history commands in the socket handler needed the concrete class. Declare the two readers on Server_DatabaseInterface with empty/false defaults, mark the Servatrice implementations as overrides, and resolve the private-chat peer through the already-promoted getUserId.
This commit is contained in:
BruebachL 2026-11-10 12:16:21 +01:00 • committed by GitHub
parent 2ca3117765
commit 28f92ac5f5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 36 additions and 7 deletions

View file

@ -2,7 +2,9 @@
#define SERVER_DATABASE_INTERFACE_H
#include "libcockatrice/protocol/pb/serverinfo_ban.pb.h"
#include "libcockatrice/protocol/pb/serverinfo_chat_message.pb.h"
#include "libcockatrice/protocol/pb/serverinfo_moderator_login.pb.h"
#include "libcockatrice/protocol/pb/serverinfo_private_chat_message.pb.h"
#include "libcockatrice/protocol/pb/serverinfo_user.pb.h"
#include "libcockatrice/protocol/pb/serverinfo_user_alt.pb.h"
#include "libcockatrice/protocol/pb/serverinfo_user_session.pb.h"
@ -128,6 +130,33 @@ public:
{
return {};
}
virtual QList<ServerInfo_ChatMessage> getMessageLogHistory(const QString & /* user */,
const QString & /* ipaddress */,
const QString & /* gamename */,
const QString & /* gameid */,
const QString & /* message */,
bool & /* chat */,
bool & /* game */,
bool & /* room */,
int & /* range */,
int & /* maxresults */,
int /* offset */ = 0,
const QString & /* beforeTime */ = QString(),
bool * /* hasMore */ = nullptr)
{
return {};
}
virtual bool getPrivateChatHistory(int /* callerId */,
const QString & /* callerName */,
int /* peerId */,
const QString & /* peerName */,
quint64 /* before */,
int /* limit */,
QList<ServerInfo_PrivateChatMessage> & /* messages */,
bool & /* hasMore */)
{
return false;
}
/**
* @brief Whether the backing store is reachable, reconnecting when it is not.
*