aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/server/ServerManager.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/juick/server/ServerManager.java')
-rw-r--r--src/main/java/com/juick/server/ServerManager.java5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/main/java/com/juick/server/ServerManager.java b/src/main/java/com/juick/server/ServerManager.java
index ef848526..586d5962 100644
--- a/src/main/java/com/juick/server/ServerManager.java
+++ b/src/main/java/com/juick/server/ServerManager.java
@@ -140,7 +140,6 @@ public class ServerManager implements NotificationListener {
try {
String json = jsonMapper.writeValueAsString(jmsg);
- com.juick.Message op = messagesService.getMessage(jmsg.getMid());
List<Integer> threadUsers =
subscribedUsers
.stream().map(User::getUid).collect(Collectors.toList());
@@ -187,10 +186,10 @@ public class ServerManager implements NotificationListener {
onJuickPM(jmsg.getTo(), jmsg);
} else if (!MessageUtils.isReply(jmsg)) {
// to get full message with attachment, etc.
- onJuickMessagePost(messagesService.getMessage(jmsg.getMid()), subscribedUsers);
+ onJuickMessagePost(messagesService.getMessage(jmsg.getMid()).orElseThrow(IllegalStateException::new), subscribedUsers);
} else {
// to get quote and attachment
- Message op = messagesService.getMessage(jmsg.getMid());
+ Message op = messagesService.getMessage(jmsg.getMid()).orElseThrow(IllegalStateException::new);
com.juick.Message reply = messagesService.getReply(jmsg.getMid(), jmsg.getRid());
subscriptionService.getUsersSubscribedToComments(op, reply, true).stream()
.filter(u -> userService.isReplyToBL(u, reply))