From a9994ef5aa7e82dd88c4a6a6e9112249e71f26c8 Mon Sep 17 00:00:00 2001 From: Moxie Marlinspike Date: Mon, 3 Feb 2014 11:51:22 -0800 Subject: [PATCH] Fix IncomingMessage requirements. --- .../textsecuregcm/controllers/MessageController.java | 4 +++- .../textsecuregcm/entities/IncomingMessage.java | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/whispersystems/textsecuregcm/controllers/MessageController.java b/src/main/java/org/whispersystems/textsecuregcm/controllers/MessageController.java index bfb3f156f..9b6db2f4b 100644 --- a/src/main/java/org/whispersystems/textsecuregcm/controllers/MessageController.java +++ b/src/main/java/org/whispersystems/textsecuregcm/controllers/MessageController.java @@ -235,7 +235,9 @@ public class MessageController { String destination = null; for (IncomingMessage message : messages) { - if (destination != null && !destination.equals(message.getDestination())) { + if ((message.getDestination() == null) || + (destination != null && !destination.equals(message.getDestination()))) + { throw new ValidationException("Multiple account destinations!"); } diff --git a/src/main/java/org/whispersystems/textsecuregcm/entities/IncomingMessage.java b/src/main/java/org/whispersystems/textsecuregcm/entities/IncomingMessage.java index 5af4e79f3..06bee1635 100644 --- a/src/main/java/org/whispersystems/textsecuregcm/entities/IncomingMessage.java +++ b/src/main/java/org/whispersystems/textsecuregcm/entities/IncomingMessage.java @@ -25,7 +25,6 @@ public class IncomingMessage { private int type; @JsonProperty - @NotEmpty private String destination; @JsonProperty