Always fix up posts and replies.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 17 Nov 2010 21:23:38 +0000 (22:23 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 17 Nov 2010 21:23:38 +0000 (22:23 +0100)
src/main/java/net/pterodactylus/sone/core/Core.java

index 1faca35..4561b6d 100644 (file)
@@ -823,8 +823,8 @@ public class Core implements IdentityListener {
                                }
                                synchronized (newPosts) {
                                        for (Post post : sone.getPosts()) {
+                                               post.setSone(getSone(post.getSone().getId()));
                                                if (!storedSone.getPosts().contains(post) && !knownPosts.contains(post.getId())) {
-                                                       post.setSone(getSone(post.getSone().getId()));
                                                        newPosts.add(post.getId());
                                                        coreListenerManager.fireNewPostFound(post);
                                                }
@@ -840,8 +840,8 @@ public class Core implements IdentityListener {
                                }
                                synchronized (newReplies) {
                                        for (Reply reply : sone.getReplies()) {
+                                               reply.setSone(getSone(reply.getSone().getId()));
                                                if (!storedSone.getReplies().contains(reply) && !knownReplies.contains(reply.getId())) {
-                                                       reply.setSone(getSone(reply.getSone().getId()));
                                                        newReplies.add(reply.getId());
                                                        coreListenerManager.fireNewReplyFound(reply);
                                                }