mirror of
https://github.com/signalapp/Signal-Server.git
synced 2026-12-01 04:06:47 +00:00
Simplify construction of spam reporting token providers
This commit is contained in:
1 parent
cb72158abc
commit
b041566aba
1 file changed
+1
-11
+1
-11
@@ -23,16 +23,6 @@ public interface ReportSpamTokenProvider {
|
||||
* @return the provider
|
||||
*/
|
||||
static ReportSpamTokenProvider noop() {
|
||||
return create(c -> Optional.empty());
|
||||
}
|
||||
|
||||
/**
|
||||
* Provider which generates ReportSpamTokens using the given function
|
||||
*
|
||||
* @param fn function from message requests to optional tokens
|
||||
* @return the provider
|
||||
*/
|
||||
static ReportSpamTokenProvider create(Function<ContainerRequestContext, Optional<byte[]>> fn) {
|
||||
return fn::apply;
|
||||
return context -> Optional.empty();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user