Don't consider empty relays present on receipt delivery.

This commit is contained in:
Moxie Marlinspike 2015-03-09 15:41:50 -07:00
parent de2f0914f0
commit 6ef3845a34
1 changed files with 5 additions and 2 deletions

View File

@ -49,8 +49,11 @@ public class ReceiptController {
throws IOException
{
try {
if (relay.isPresent()) sendRelayedReceipt(source, destination, messageId, relay.get());
else sendDirectReceipt(source, destination, messageId);
if (relay.isPresent() && !relay.get().isEmpty()) {
sendRelayedReceipt(source, destination, messageId, relay.get());
} else {
sendDirectReceipt(source, destination, messageId);
}
} catch (NoSuchUserException | NotPushRegisteredException e) {
throw new WebApplicationException(Response.Status.NOT_FOUND);
} catch (TransientPushFailureException e) {