mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-10 03:53:26 -08:00
[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:
parent
9b00972b4d
commit
fb836c6e0c
4 changed files with 242 additions and 87 deletions
|
|
@ -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> ¬ifications) override;
|
||||
void markReportNotified(int reportId) override;
|
||||
bool getPendingReportCommentNotifications(
|
||||
int userId,
|
||||
QList<Server_DatabaseInterface::PendingReportCommentNotification> ¬ifications) override;
|
||||
void markReportCommentNotified(qlonglong commentId) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue