Fix logging.
[Sone.git] / src / main / java / net / pterodactylus / sone / core / Core.java
index da2a2a1..811950d 100644 (file)
@@ -24,8 +24,8 @@ import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
-import java.util.Set;
 import java.util.Map.Entry;
+import java.util.Set;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.logging.Level;
@@ -40,12 +40,12 @@ import net.pterodactylus.sone.data.Image;
 import net.pterodactylus.sone.data.Post;
 import net.pterodactylus.sone.data.PostReply;
 import net.pterodactylus.sone.data.Profile;
+import net.pterodactylus.sone.data.Profile.Field;
 import net.pterodactylus.sone.data.Reply;
 import net.pterodactylus.sone.data.Sone;
-import net.pterodactylus.sone.data.TemporaryImage;
-import net.pterodactylus.sone.data.Profile.Field;
 import net.pterodactylus.sone.data.Sone.ShowCustomAvatars;
 import net.pterodactylus.sone.data.Sone.SoneStatus;
+import net.pterodactylus.sone.data.TemporaryImage;
 import net.pterodactylus.sone.fcp.FcpInterface;
 import net.pterodactylus.sone.fcp.FcpInterface.FullAccessRequired;
 import net.pterodactylus.sone.freenet.wot.Identity;
@@ -1293,8 +1293,8 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis
        }
 
        /**
-        * Marks the given Sone as known. If the Sone was {@link #isNewPost(String)
-        * new} before, a {@link CoreListener#markSoneKnown(Sone)} event is fired.
+        * Marks the given Sone as known. If the Sone was not {@link Post#isKnown()
+        * known} before, a {@link CoreListener#markSoneKnown(Sone)} event is fired.
         *
         * @param sone
         *            The Sone to mark as known
@@ -1641,8 +1641,8 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis
        }
 
        /**
-        * Marks the given post as known, if it is currently a new post (according
-        * to {@link #isNewPost(String)}).
+        * Marks the given post as known, if it is currently not a known post
+        * (according to {@link Post#isKnown()}).
         *
         * @param post
         *            The post to mark as known
@@ -1655,6 +1655,9 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis
                                touchConfiguration();
                        }
                }
+               for (PostReply reply : getReplies(post)) {
+                       markReplyKnown(reply);
+               }
        }
 
        /**
@@ -1780,8 +1783,8 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis
        }
 
        /**
-        * Marks the given reply as known, if it is currently a new reply (according
-        * to {@link #isNewReply(String)}).
+        * Marks the given reply as known, if it is currently not a known reply
+        * (according to {@link Reply#isKnown()}).
         *
         * @param reply
         *            The reply to mark as known
@@ -2405,7 +2408,7 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis
         */
        @Override
        public void ownIdentityAdded(OwnIdentity ownIdentity) {
-               logger.log(Level.FINEST, "Adding OwnIdentity: " + ownIdentity);
+               logger.log(Level.FINEST, "Adding OwnIdentity: %s", ownIdentity);
                if (ownIdentity.hasContext("Sone")) {
                        trustedIdentities.put(ownIdentity, Collections.synchronizedSet(new HashSet<Identity>()));
                        addLocalSone(ownIdentity);
@@ -2426,7 +2429,7 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis
         */
        @Override
        public void identityAdded(OwnIdentity ownIdentity, Identity identity) {
-               logger.log(Level.FINEST, "Adding Identity: " + identity);
+               logger.log(Level.FINEST, "Adding Identity: %s", identity);
                trustedIdentities.get(ownIdentity).add(identity);
                addRemoteSone(identity);
        }