import java.util.List;
import net.pterodactylus.sone.data.Post;
+import net.pterodactylus.sone.data.Reply;
import net.pterodactylus.sone.data.Sone;
import net.pterodactylus.util.template.Template;
template.set("posts", allPosts);
}
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void postProcess(Request request, Template template) {
+ @SuppressWarnings("unchecked")
+ List<Post> posts = (List<Post>) template.get("posts");
+ for (Post post : posts) {
+ webInterface.getCore().markPostKnown(post);
+ for (Reply reply : webInterface.getCore().getReplies(post)) {
+ webInterface.getCore().markReplyKnown(reply);
+ }
+ }
+ }
+
}
package net.pterodactylus.sone.web;
import net.pterodactylus.sone.data.Post;
+import net.pterodactylus.sone.data.Reply;
import net.pterodactylus.util.template.Template;
/**
template.set("post", post);
}
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void postProcess(Request request, Template template) {
+ Post post = (Post) template.get("post");
+ webInterface.getCore().markPostKnown(post);
+ for (Reply reply : webInterface.getCore().getReplies(post)) {
+ webInterface.getCore().markReplyKnown(reply);
+ }
+ }
+
}
package net.pterodactylus.sone.web;
+import java.util.List;
+
+import net.pterodactylus.sone.data.Post;
+import net.pterodactylus.sone.data.Reply;
import net.pterodactylus.sone.data.Sone;
import net.pterodactylus.util.template.Template;
template.set("sone", sone);
}
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void postProcess(Request request, Template template) {
+ Sone sone = (Sone) template.get("sone");
+ List<Post> posts = sone.getPosts();
+ for (Post post : posts) {
+ webInterface.getCore().markPostKnown(post);
+ for (Reply reply : webInterface.getCore().getReplies(post)) {
+ webInterface.getCore().markReplyKnown(reply);
+ }
+ }
+ }
+
}