Move friend parsing to new configuration parser.
[Sone.git] / src / main / java / net / pterodactylus / sone / core / ConfigurationSoneParser.java
index 1491f87..39dcd12 100644 (file)
@@ -162,6 +162,19 @@ public class ConfigurationSoneParser {
                return likedPostReplyIds;
        }
 
+       public Set<String> parseFriends() {
+               Set<String> friends = new HashSet<String>();
+               while (true) {
+                       String friendId =
+                                       getString("/Friends/" + friends.size() + "/ID", null);
+                       if (friendId == null) {
+                               break;
+                       }
+                       friends.add(friendId);
+               }
+               return friends;
+       }
+
        public static class InvalidPostFound extends RuntimeException { }
 
        public static class InvalidPostReplyFound extends RuntimeException { }