Always fire element-was-read events, even if element is not new.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 21 Feb 2012 18:03:51 +0000 (19:03 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 21 Feb 2012 18:03:51 +0000 (19:03 +0100)
Sometimes elements are marked as read but not removed from the
notifications.

src/main/java/net/pterodactylus/sone/core/Core.java

index 108b05c..da2a2a1 100644 (file)
@@ -1650,8 +1650,8 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis
        public void markPostKnown(Post post) {
                post.setKnown(true);
                synchronized (knownPosts) {
+                       coreListenerManager.fireMarkPostKnown(post);
                        if (knownPosts.add(post.getId())) {
-                               coreListenerManager.fireMarkPostKnown(post);
                                touchConfiguration();
                        }
                }
@@ -1789,8 +1789,8 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis
        public void markReplyKnown(PostReply reply) {
                reply.setKnown(true);
                synchronized (knownReplies) {
+                       coreListenerManager.fireMarkReplyKnown(reply);
                        if (knownReplies.add(reply.getId())) {
-                               coreListenerManager.fireMarkReplyKnown(reply);
                                touchConfiguration();
                        }
                }