From ce1110cb98bf41a09c99f84bbe4ac94d4f7b4a3b Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 24 Nov 2010 11:41:14 +0100 Subject: [PATCH] Expose new posts and replies from the notifications. --- .../net/pterodactylus/sone/web/WebInterface.java | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/main/java/net/pterodactylus/sone/web/WebInterface.java b/src/main/java/net/pterodactylus/sone/web/WebInterface.java index feeab46..1c91b64 100644 --- a/src/main/java/net/pterodactylus/sone/web/WebInterface.java +++ b/src/main/java/net/pterodactylus/sone/web/WebInterface.java @@ -23,7 +23,9 @@ import java.io.Reader; import java.io.UnsupportedEncodingException; 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; @@ -218,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 // -- 2.7.4