From: David ‘Bombe’ Roden Date: Fri, 27 Jan 2012 09:17:51 +0000 (+0100) Subject: Try to prevent new elements from being stuck in the notifications. X-Git-Tag: 0.8^2~33 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=7b1a3e4378a632ad4b9e32373921cfad4fd91e8d;p=Sone.git Try to prevent new elements from being stuck in the notifications. --- diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index c58a508..7a97842 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -1707,8 +1707,8 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis */ public void markPostKnown(Post post) { synchronized (newPosts) { - if (newPosts.remove(post.getId())) { - knownPosts.add(post.getId()); + newPosts.remove(post.getId()); + if (knownPosts.add(post.getId())) { coreListenerManager.fireMarkPostKnown(post); touchConfiguration(); } @@ -1847,8 +1847,8 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis */ public void markReplyKnown(PostReply reply) { synchronized (newReplies) { - if (newReplies.remove(reply.getId())) { - knownReplies.add(reply.getId()); + newReplies.remove(reply.getId()); + if (knownReplies.add(reply.getId())) { coreListenerManager.fireMarkReplyKnown(reply); touchConfiguration(); }