projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Factor out some methods.
[Sone.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
sone
/
web
/
WebInterface.java
diff --git
a/src/main/java/net/pterodactylus/sone/web/WebInterface.java
b/src/main/java/net/pterodactylus/sone/web/WebInterface.java
index
3bb11d5
..
f6645ca
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/web/WebInterface.java
+++ b/
src/main/java/net/pterodactylus/sone/web/WebInterface.java
@@
-150,11
+150,6
@@
import net.pterodactylus.util.web.RedirectPage;
import net.pterodactylus.util.web.StaticPage;
import net.pterodactylus.util.web.TemplatePage;
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.clients.http.SessionManager;
import freenet.clients.http.SessionManager.Session;
import freenet.clients.http.ToadletContainer;
@@
-162,6
+157,11
@@
import freenet.clients.http.ToadletContext;
import freenet.l10n.BaseL10n;
import freenet.support.api.HTTPRequest;
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.
/**
* Bundles functionality that a web interface of a Freenet plugin needs, e.g.
* references to l10n helpers.
@@
-423,7
+423,7
@@
public class WebInterface {
if (soneId == null) {
return null;
}
if (soneId == null) {
return null;
}
- return getCore().getLocalSone(soneId
, false
);
+ return getCore().getLocalSone(soneId
).orNull(
);
}
/**
}
/**
@@
-938,9
+938,9
@@
public class WebInterface {
PostReply reply = postReplyRemovedEvent.postReply();
newReplyNotification.remove(reply);
localReplyNotification.remove(reply);
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;
boolean isMentioned = false;
- for (PostReply existingReply : getCore().getReplies(reply.getPost
().get
())) {
+ for (PostReply existingReply : getCore().getReplies(reply.getPost
Id
())) {
isMentioned |= !reply.isKnown() && !getMentionedSones(existingReply.getText()).isEmpty();
}
if (!isMentioned) {
isMentioned |= !reply.isKnown() && !getMentionedSones(existingReply.getText()).isEmpty();
}
if (!isMentioned) {