synchronized (newPosts) {
boolean isNew = !knownPosts.contains(postId) && newPosts.remove(postId);
knownPosts.add(postId);
+ if (isNew) {
+ coreListenerManager.fireMarkPostKnown(getPost(postId));
+ }
return isNew;
}
}
synchronized (newReplies) {
boolean isNew = !knownReplies.contains(replyId) && newReplies.remove(replyId);
knownReplies.add(replyId);
+ if (isNew) {
+ coreListenerManager.fireMarkReplyKnown(getReply(replyId));
+ }
return isNew;
}
}
*/
public void markSoneKnown(Sone sone);
+ /**
+ * Notifies a listener that the given post is now marked as known.
+ *
+ * @param post
+ * The known post
+ */
+ public void markPostKnown(Post post);
+
+ /**
+ * Notifies a listener that the given reply is now marked as known.
+ *
+ * @param reply
+ * The known reply
+ */
+ public void markReplyKnown(Reply reply);
+
}
}
}
+ /**
+ * Notifies all listeners that the given post is now marked as known.
+ *
+ * @param post
+ * The known post
+ */
+ void fireMarkPostKnown(Post post) {
+ for (CoreListener coreListener : getListeners()) {
+ coreListener.markPostKnown(post);
+ }
+ }
+
+ /**
+ * Notifies all listeners that the given reply is now marked as known.
+ *
+ * @param reply
+ * The known reply
+ */
+ void fireMarkReplyKnown(Reply reply) {
+ for (CoreListener coreListener : getListeners()) {
+ coreListener.markReplyKnown(reply);
+ }
+ }
+
}
}
/**
+ * {@inheritDoc}
+ */
+ @Override
+ public void markPostKnown(Post post) {
+ /* TODO */
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void markReplyKnown(Reply reply) {
+ /* TODO */
+ }
+
+ /**
* Template provider implementation that uses
* {@link WebInterface#createReader(String)} to load templates for
* inclusion.