diff options
author | 2018-02-25 09:04:17 +0300 | |
---|---|---|
committer | 2018-03-21 11:45:00 +0300 | |
commit | 9b201b07dc6caa147ea79b359e448f2649353039 (patch) | |
tree | 02f732c7ba6e249a4b65998c4584c14d1c0cb91c /juick-www/src/main | |
parent | 1e4198d2aad02eca56157fcd24425a1eaa6041ee (diff) |
xmpp: recommend command
Diffstat (limited to 'juick-www/src/main')
-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 a252bb69..531babd2 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, |