[Server] Serve report aggregates through the database interface

cmdReportStats and cmdReportUserInfo still ran their queries inline through
Servatrice_DatabaseInterface and built the response in the socket handler. Add
ReportStatsRecord, ReportUserInfoRecord and their count records to
Server_DatabaseInterface with fail-closed defaults, implement getReportStats and
getReportUserInfo with the previous statements and query order, and keep
presence flags for the fields the old code set only on a successful query so
the proto2 wire output is unchanged. The stats cache decision and every response
code stay in the handler.
This commit is contained in:
Lukas Brübach 2026-11-10 01:19:55 +01:00
parent 8ee2a75b2a
commit 3f9e53eb2f
4 changed files with 309 additions and 144 deletions

View file

@ -301,6 +301,8 @@ public:
Server_DatabaseInterface::ReportLookupResult
getReportForDetails(int reportId, int &reporterId, ServerInfo_Report &report) override;
bool getReportComments(int reportId, QList<ServerInfo_ReportComment> &comments) override;
bool getReportStats(ReportStatsRecord &stats) override;
bool getReportUserInfo(const QString &userName, ReportUserInfoRecord &info) override;
bool addReport(int reporterId,
const QString &reporterName,
int reportedUserId,