X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fcore%2FCore.java;h=1bf66479822563deeb3708c5a55138ad1c24327d;hb=b9556a5c45d39a82f8f4f94a983ef581d487b50f;hp=7872c94cbc0eedbf19bbe227724544d561692f1e;hpb=3491bcaaa2305f34e9d41750d288564628a14614;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 7872c94..1bf6647 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -95,6 +95,9 @@ public class Core implements IdentityListener { /** The Sone downloader. */ private final SoneDownloader soneDownloader; + /** Whether the core has been stopped. */ + private volatile boolean stopped; + /** The Sones’ statuses. */ /* synchronize access on itself. */ private final Map soneStatuses = new HashMap(); @@ -734,6 +737,7 @@ public class Core implements IdentityListener { for (Post post : sone.getPosts()) { if (!storedSone.getPosts().contains(post) && !knownPosts.contains(post.getId())) { newPosts.add(post.getId()); + coreListenerManager.fireNewPostFound(post); } posts.put(post.getId(), post); } @@ -747,6 +751,7 @@ public class Core implements IdentityListener { for (Reply reply : sone.getReplies()) { if (!storedSone.getReplies().contains(reply) && !knownReplies.contains(reply.getId())) { newReplies.add(reply.getId()); + coreListenerManager.fireNewReplyFound(reply); } replies.put(reply.getId(), reply); } @@ -1138,6 +1143,7 @@ public class Core implements IdentityListener { } } saveConfiguration(); + stopped = true; } //