mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-20 20:48:06 +01:00
Fix a counting bug with reported messages
This commit is contained in:
@@ -503,7 +503,7 @@ public class MessageController {
|
||||
public Response reportMessage(@Auth AuthenticatedAccount auth, @PathParam("sourceNumber") String sourceNumber,
|
||||
@PathParam("messageGuid") UUID messageGuid) {
|
||||
|
||||
reportMessageManager.report(sourceNumber, messageGuid);
|
||||
reportMessageManager.report(sourceNumber, messageGuid, auth.getAccount().getUuid());
|
||||
|
||||
return Response.status(Status.ACCEPTED)
|
||||
.build();
|
||||
|
||||
@@ -54,7 +54,7 @@ public class ReportMessageManager {
|
||||
}
|
||||
}
|
||||
|
||||
public void report(String sourceNumber, UUID messageGuid) {
|
||||
public void report(String sourceNumber, UUID messageGuid, UUID reporterUuid) {
|
||||
|
||||
final boolean found = reportMessageDynamoDb.remove(hash(messageGuid, sourceNumber));
|
||||
|
||||
@@ -62,7 +62,7 @@ public class ReportMessageManager {
|
||||
rateLimitCluster.useCluster(connection -> {
|
||||
final String reportedSenderKey = getReportedSenderKey(sourceNumber);
|
||||
|
||||
connection.sync().pfadd(reportedSenderKey, sourceNumber);
|
||||
connection.sync().pfadd(reportedSenderKey, reporterUuid.toString());
|
||||
connection.sync().expire(reportedSenderKey, counterTtl.toSeconds());
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user