Pass AccountAndAuthenticatedDeviceHolder to spam filter
This commit is contained in:
parent
f52c40a492
commit
ec009a2bba
|
@ -327,7 +327,7 @@ public class MessageController {
|
||||||
|
|
||||||
final Optional<byte[]> spamReportToken = switch (senderType) {
|
final Optional<byte[]> spamReportToken = switch (senderType) {
|
||||||
case SENDER_TYPE_IDENTIFIED ->
|
case SENDER_TYPE_IDENTIFIED ->
|
||||||
reportSpamTokenProvider.makeReportSpamToken(context, source.get().getAccount(), destination);
|
reportSpamTokenProvider.makeReportSpamToken(context, source.get(), destination);
|
||||||
default -> Optional.empty();
|
default -> Optional.empty();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
package org.whispersystems.textsecuregcm.spam;
|
package org.whispersystems.textsecuregcm.spam;
|
||||||
|
|
||||||
|
import org.whispersystems.textsecuregcm.auth.AccountAndAuthenticatedDeviceHolder;
|
||||||
import org.whispersystems.textsecuregcm.storage.Account;
|
import org.whispersystems.textsecuregcm.storage.Account;
|
||||||
import javax.ws.rs.container.ContainerRequestContext;
|
import javax.ws.rs.container.ContainerRequestContext;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.function.Function;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generates ReportSpamTokens to be used for spam reports.
|
* Generates ReportSpamTokens to be used for spam reports.
|
||||||
|
@ -18,7 +18,7 @@ public interface ReportSpamTokenProvider {
|
||||||
* @param maybeDestination the intended recepient of the message if available
|
* @param maybeDestination the intended recepient of the message if available
|
||||||
* @return either a generated token or nothing
|
* @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);
|
final Optional<Account> maybeDestination);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue