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.
public WebInterface(SonePlugin sonePlugin) {
this.sonePlugin = sonePlugin;
formPassword = sonePlugin.pluginRespirator().getToadletContainer().getFormPassword();
- soneTextParser = new SoneTextParser(getCore(), getCore());
+ soneTextParser = new SoneTextParser(getCore().getDatabase());
templateContextFactory = new TemplateContextFactory();
templateContextFactory.addAccessor(Object.class, new ReflectionAccessor());
if (soneId == null) {
return null;
}
- return getCore().getLocalSone(soneId, false);
+ return getCore().getLocalSone(soneId).orNull();
}
/**
localReplyNotification.remove(reply);
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) {