X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FWebInterface.java;h=593193c0ddffb204cb967cf333ee463e7fed6595;hb=dd0d48b90db1a4569926cc81e5744a6b691a5291;hp=d9a9dfbdb273490eb187114e3c9868df8d42da9e;hpb=9161c1d7f558fee1cde877b8179463b113671d07;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/web/WebInterface.java b/src/main/java/net/pterodactylus/sone/web/WebInterface.java index d9a9dfb..593193c 100644 --- a/src/main/java/net/pterodactylus/sone/web/WebInterface.java +++ b/src/main/java/net/pterodactylus/sone/web/WebInterface.java @@ -857,8 +857,8 @@ public class WebInterface { } if (!hasFirstStartNotification()) { notificationManager.addNotification(isLocal ? localReplyNotification : newReplyNotification); - if (!getMentionedSones(reply.getText()).isEmpty() && !isLocal && (reply.getPost().getSone() != null) && (reply.getTime() <= System.currentTimeMillis())) { - mentionNotification.add(reply.getPost()); + if (!getMentionedSones(reply.getText()).isEmpty() && !isLocal && reply.getPost().isPresent() && (reply.getTime() <= System.currentTimeMillis())) { + mentionNotification.add(reply.getPost().get()); notificationManager.addNotification(mentionNotification); } } else { @@ -900,7 +900,7 @@ public class WebInterface { public void markReplyKnown(MarkPostReplyKnownEvent markPostReplyKnownEvent) { newReplyNotification.remove(markPostReplyKnownEvent.postReply()); localReplyNotification.remove(markPostReplyKnownEvent.postReply()); - mentionNotification.remove(markPostReplyKnownEvent.postReply().getPost()); + mentionNotification.remove(markPostReplyKnownEvent.postReply().getPost().get()); } /** @@ -938,13 +938,13 @@ public class WebInterface { PostReply reply = postReplyRemovedEvent.postReply(); newReplyNotification.remove(reply); localReplyNotification.remove(reply); - if (!getMentionedSones(reply.getText()).isEmpty()) { + if (!getMentionedSones(reply.getText()).isEmpty() && reply.getPost().isPresent()) { boolean isMentioned = false; - for (PostReply existingReply : getCore().getReplies(reply.getPost())) { + for (PostReply existingReply : getCore().getReplies(reply.getPostId())) { isMentioned |= !reply.isKnown() && !getMentionedSones(existingReply.getText()).isEmpty(); } if (!isMentioned) { - mentionNotification.remove(reply.getPost()); + mentionNotification.remove(reply.getPost().get()); } } }