import net.pterodactylus.util.web.StaticPage;
import net.pterodactylus.util.web.TemplatePage;
-import com.google.common.collect.Collections2;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.eventbus.Subscribe;
-import com.google.inject.Inject;
-
import freenet.clients.http.SessionManager;
import freenet.clients.http.SessionManager.Session;
import freenet.clients.http.ToadletContainer;
import freenet.l10n.BaseL10n;
import freenet.support.api.HTTPRequest;
+import com.google.common.collect.Collections2;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.eventbus.Subscribe;
+import com.google.inject.Inject;
+
/**
* Bundles functionality that a web interface of a Freenet plugin needs, e.g.
* references to l10n helpers.
if (soneId == null) {
return null;
}
- return getCore().getLocalSone(soneId, false);
+ return getCore().getLocalSone(soneId).orNull();
}
/**
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().get())) {
+ for (PostReply existingReply : getCore().getReplies(reply.getPostId())) {
isMentioned |= !reply.isKnown() && !getMentionedSones(existingReply.getText()).isEmpty();
}
if (!isMentioned) {