[Server] Serve report aggregates through the database interface (#7845)

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:
BruebachL 2026-11-10 12:16:28 +01:00 • committed by GitHub
parent 2ba80cb61d
commit a54e13756c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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,