mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-22 06:38:05 +01:00
Simplify returning spam responses from gRPC
This commit is contained in:
committed by
Jon Chambers
parent
11df8fcc6c
commit
37c4a0451a
@@ -106,13 +106,7 @@ public class MessagesAnonymousGrpcService extends SimpleMessagesAnonymousGrpc.Me
|
||||
destinationServiceIdentifier);
|
||||
|
||||
if (spamCheckResult.response().isPresent()) {
|
||||
final GrpcResponse<SendMessageResponse> response = spamCheckResult.response().get();
|
||||
|
||||
if (response.response().isPresent()) {
|
||||
return response.response().get();
|
||||
}
|
||||
|
||||
throw response.status().asException();
|
||||
return spamCheckResult.response().get().getResponseOrThrowStatus();
|
||||
}
|
||||
|
||||
try {
|
||||
@@ -205,13 +199,7 @@ public class MessagesAnonymousGrpcService extends SimpleMessagesAnonymousGrpc.Me
|
||||
spamChecker.checkForMultiRecipientSpamGrpc(MessageType.MULTI_RECIPIENT_SEALED_SENDER);
|
||||
|
||||
if (spamCheckResult.response().isPresent()) {
|
||||
final GrpcResponse<SendMultiRecipientMessageResponse> response = spamCheckResult.response().get();
|
||||
|
||||
if (response.response().isPresent()) {
|
||||
return response.response().get();
|
||||
}
|
||||
|
||||
throw response.status().asException();
|
||||
return spamCheckResult.response().get().getResponseOrThrowStatus();
|
||||
}
|
||||
|
||||
// At this point, the caller has at least superficially provided the information needed to send a multi-recipient
|
||||
|
||||
Reference in New Issue
Block a user