X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fcore%2FCore.java;h=3f2111a6e32dc49b5c142505e7863f7cfdb9e632;hp=0e7f1631782bb96b34972ec2524bb918d2454127;hb=9dafc7dd9ac7da59e0b27581ea360f69e6097531;hpb=700c5d1f88629ceea4674f60213925cdda482d6a diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index 0e7f163..3f2111a 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -1203,6 +1203,22 @@ public class Core implements IdentityListener { } /** + * Marks the given post as known, if it is currently a new post (according + * to {@link #isNewPost(String)}). + * + * @param post + * The post to mark as known + */ + public void markPostKnown(Post post) { + synchronized (newPosts) { + if (newPosts.remove(post.getId())) { + knownPosts.add(post.getId()); + coreListenerManager.fireMarkPostKnown(post); + } + } + } + + /** * Creates a new reply. * * @param sone @@ -1252,6 +1268,22 @@ public class Core implements IdentityListener { } /** + * Marks the given reply as known, if it is currently a new reply (according + * to {@link #isNewReply(String)}). + * + * @param reply + * The reply to mark as known + */ + public void markReplyKnown(Reply reply) { + synchronized (newReplies) { + if (newReplies.remove(reply.getId())) { + knownReplies.add(reply.getId()); + coreListenerManager.fireMarkReplyKnown(reply); + } + } + } + + /** * Starts the core. */ public void start() {