diff options
Diffstat (limited to 'juick-www/src/main/java/com')
-rw-r--r-- | juick-www/src/main/java/com/juick/www/controllers/NewMessage.java | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/juick-www/src/main/java/com/juick/www/controllers/NewMessage.java b/juick-www/src/main/java/com/juick/www/controllers/NewMessage.java index a252bb697..531babd22 100644 --- a/juick-www/src/main/java/com/juick/www/controllers/NewMessage.java +++ b/juick-www/src/main/java/com/juick/www/controllers/NewMessage.java @@ -310,9 +310,9 @@ public class NewMessage { throw new HttpForbiddenException(); } - boolean res = messagesService.recommendMessage(mid, visitor.getUid()); + MessagesService.RecommendStatus res = messagesService.recommendMessage(mid, visitor.getUid()); - if (res) { + if (res == MessagesService.RecommendStatus.Added) { if (xmpp.isConnected()) { Message xmsg = new Message(); xmsg.setFrom(Jid.of("juick@juick.com")); @@ -325,11 +325,10 @@ public class NewMessage { } else { logger.warn("XMPP unavailable"); } - - return Status.OK; - } else { + } else if (res == MessagesService.RecommendStatus.Error) { throw new HttpBadRequestException(); } + return Status.OK; } @PostMapping("/pm/send") public String doPostPM(@RequestParam(name = "uname", required = false) String unameParam, |