Set known flag correctly when finding new posts and replies.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 16 Oct 2012 07:15:48 +0000 (09:15 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 16 Oct 2012 07:15:48 +0000 (09:15 +0200)
src/main/java/net/pterodactylus/sone/core/Core.java

index c391582..4761959 100644 (file)
@@ -1160,8 +1160,8 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis
                                                if (!storedPosts.contains(post)) {
                                                        if (post.getTime() < getSoneFollowingTime(sone)) {
                                                                knownPosts.add(post.getId());
+                                                               post.setKnown(true);
                                                        } else if (!knownPosts.contains(post.getId())) {
-                                                               sone.setKnown(false);
                                                                coreListenerManager.fireNewPostFound(post);
                                                        }
                                                }
@@ -1185,8 +1185,8 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis
                                                if (!storedReplies.contains(reply)) {
                                                        if (reply.getTime() < getSoneFollowingTime(sone)) {
                                                                knownReplies.add(reply.getId());
+                                                               reply.setKnown(true);
                                                        } else if (!knownReplies.contains(reply.getId())) {
-                                                               reply.setKnown(false);
                                                                coreListenerManager.fireNewReplyFound(reply);
                                                        }
                                                }