X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FWebInterface.java;h=a7b67288fb425ccd108930989df96c1f2d15f73b;hb=2a69c05787c49cdb8bf88a1d7e89226237f11d70;hp=31f9f0d304a7248fb2fd265e3e646bbbe2662f50;hpb=80822a0b544648746b293b562eed1da88e439991;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 31f9f0d..a7b6728 100644 --- a/src/main/java/net/pterodactylus/sone/web/WebInterface.java +++ b/src/main/java/net/pterodactylus/sone/web/WebInterface.java @@ -21,11 +21,11 @@ import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import java.io.UnsupportedEncodingException; -import java.net.URI; -import java.net.URISyntaxException; import java.util.ArrayList; import java.util.Collection; +import java.util.HashSet; import java.util.List; +import java.util.Set; import java.util.logging.Level; import java.util.logging.Logger; @@ -208,12 +208,7 @@ public class WebInterface implements CoreListener { * @return The node’s session manager */ public SessionManager getSessionManager() { - try { - return sonePlugin.pluginRespirator().getSessionManager(new URI("/")); - } catch (URISyntaxException use1) { - logger.log(Level.SEVERE, "Could not get Session Manager!", use1); - return null; - } + return sonePlugin.pluginRespirator().getSessionManager("Sone"); } /** @@ -225,6 +220,26 @@ public class WebInterface implements CoreListener { return formPassword; } + /** + * Returns the posts that have been announced as new in the + * {@link #newPostNotification}. + * + * @return The new posts + */ + public Set getNewPosts() { + return new HashSet(newPostNotification.getElements()); + } + + /** + * Returns the replies that have been announced as new in the + * {@link #newReplyNotification}. + * + * @return The new replies + */ + public Set getNewReplies() { + return new HashSet(newReplyNotification.getElements()); + } + // // ACTIONS // @@ -306,6 +321,7 @@ public class WebInterface implements CoreListener { Template logoutTemplate = templateFactory.createTemplate(createReader("/templates/logout.html")); Template optionsTemplate = templateFactory.createTemplate(createReader("/templates/options.html")); Template aboutTemplate = templateFactory.createTemplate(createReader("/templates/about.html")); + Template postTemplate = templateFactory.createTemplate(createReader("/templates/include/viewPost.html")); Template replyTemplate = templateFactory.createTemplate(createReader("/templates/include/viewReply.html")); PageToadletFactory pageToadletFactory = new PageToadletFactory(sonePlugin.pluginRespirator().getHLSimpleClient(), "/Sone/");