X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fcore%2FCore.java;h=af1523aa0324a8ecb758d8fdf8d4ee70a17d58bc;hb=6794610cdd7e73db26ae74e927506396abceeea3;hp=52b885e011ce4e840db70a95a3316824152b48f7;hpb=d1c7f645f187884df0171309ecb63617373afb59;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index 52b885e..af1523a 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -306,6 +306,20 @@ public class Core implements IdentityListener { } /** + * Returns whether the Sone with the given ID is a remote Sone. + * + * @param id + * The ID of the Sone to check + * @return {@code true} if the Sone with the given ID is a remote Sone, + * {@code false} otherwise + */ + public boolean isRemoteSone(String id) { + synchronized (remoteSones) { + return remoteSones.containsKey(id); + } + } + + /** * Returns the post with the given ID. * * @param postId @@ -499,6 +513,7 @@ public class Core implements IdentityListener { sone.setLatestEdition(Numbers.safeParseLong(identity.getProperty("Sone.LatestEdition"), (long) 0)); remoteSones.put(identity.getId(), sone); soneDownloader.addSone(sone); + setSoneStatus(sone, SoneStatus.unknown); new Thread(new Runnable() { @Override @@ -508,7 +523,6 @@ public class Core implements IdentityListener { } }, "Sone Downloader").start(); - setSoneStatus(sone, SoneStatus.idle); return sone; } }