[Server] Serve report submission through the database interface (#7843)

cmdReport and sendPendingReportNotifications still issued their SQL inline
through Servatrice_DatabaseInterface: the daily report cap, the reported-user
lookup, the report insert, both pending-notification selects and the notified
flips. Add the two notification records and seven report methods to
Server_DatabaseInterface with fail-closed defaults, implement them with the
previous statements and binds, and let both functions ask the injected
interface. Check order, response codes and notification payloads are unchanged.
This commit is contained in:
BruebachL 2026-11-10 12:16:27 +01:00 • committed by GitHub
parent 9b00972b4d
commit fb836c6e0c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 242 additions and 87 deletions

View file

@ -289,6 +289,25 @@ public:
const QString &action,
const QString &details,
bool results) override;
int countReportsSubmittedInLastDay(int reporterId) override;
int getReportedUserId(const QString &userName) override;
bool addReport(int reporterId,
const QString &reporterName,
int reportedUserId,
const QString &reportedUserName,
int gameId,
int roomId,
const QString &category,
const QString &description,
const QString &chatLog) override;
bool
getPendingReportNotifications(int reporterId,
QList<Server_DatabaseInterface::PendingReportNotification> &notifications) override;
void markReportNotified(int reportId) override;
bool getPendingReportCommentNotifications(
int userId,
QList<Server_DatabaseInterface::PendingReportCommentNotification> &notifications) override;
void markReportCommentNotified(qlonglong commentId) override;
};
#endif