[Server] Serve report submission through the database interface

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:
Lukas Brübach 2026-11-10 01:09:57 +01:00
parent 81f5e1b203
commit 49072d5fee
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