Skip to content

Commit

Permalink
Pass AccountAndAuthenticatedDeviceHolder to spam filter
Browse files Browse the repository at this point in the history
  • Loading branch information
ameya-signal committed Jun 26, 2024
1 parent f52c40a commit ec009a2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ public Response sendMessage(@ReadOnly @Auth Optional<AuthenticatedAccount> sourc

final Optional<byte[]> spamReportToken = switch (senderType) {
case SENDER_TYPE_IDENTIFIED ->
reportSpamTokenProvider.makeReportSpamToken(context, source.get().getAccount(), destination);
reportSpamTokenProvider.makeReportSpamToken(context, source.get(), destination);
default -> Optional.empty();
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package org.whispersystems.textsecuregcm.spam;

import org.whispersystems.textsecuregcm.auth.AccountAndAuthenticatedDeviceHolder;
import org.whispersystems.textsecuregcm.storage.Account;
import javax.ws.rs.container.ContainerRequestContext;
import java.util.Optional;
import java.util.function.Function;

/**
* Generates ReportSpamTokens to be used for spam reports.
Expand All @@ -18,7 +18,7 @@ public interface ReportSpamTokenProvider {
* @param maybeDestination the intended recepient of the message if available
* @return either a generated token or nothing
*/
Optional<byte[]> makeReportSpamToken(ContainerRequestContext context, final Account sender,
Optional<byte[]> makeReportSpamToken(ContainerRequestContext context, final AccountAndAuthenticatedDeviceHolder sender,
final Optional<Account> maybeDestination);

/**
Expand Down

0 comments on commit ec009a2

Please sign in to comment.