Load known post replies in configuration loader, too.
[Sone.git] / src / main / java / net / pterodactylus / sone / database / memory / ConfigurationLoader.java
index 39f2ca1..078b5f4 100644 (file)
@@ -33,4 +33,19 @@ public class ConfigurationLoader {
                return knownPosts;
        }
 
+       public synchronized Set<String> loadKnownPostReplies() {
+               Set<String> knownPostReplies = new HashSet<String>();
+               int replyCounter = 0;
+               while (true) {
+                       String knownReplyId = configuration
+                                       .getStringValue("KnownReplies/" + replyCounter++ + "/ID")
+                                       .getValue(null);
+                       if (knownReplyId == null) {
+                               break;
+                       }
+                       knownPostReplies.add(knownReplyId);
+               }
+               return knownPostReplies;
+       }
+
 }