X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fcore%2FCore.java;h=055ede4a30c59c5036bdd78730861292ba92a335;hp=132e4a605249c1c826e7f148eeb8eeb480d1c4ad;hb=0dc8ce4308f55d8f13e41c7ac312c11a379418b9;hpb=6fa3e26eb2deda14bd56dd343011b5735d449104 diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index 132e4a6..055ede4 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -323,6 +323,21 @@ public class Core implements IdentityListener { } /** + * Returns whether the given Sone is a new Sone. After this check, the Sone + * is marked as known, i.e. a second call with the same parameters will + * always yield {@code false}. + * + * @param sone + * The sone to check for + * @return {@code true} if the given Sone is new, false otherwise + */ + public boolean isNewSone(Sone sone) { + synchronized (newSones) { + return newSones.remove(sone); + } + } + + /** * Returns the post with the given ID. * * @param postId