Remove post reply management from Sone.
[Sone.git] / src / main / java / net / pterodactylus / sone / data / impl / SoneImpl.java
index 142f4a2..eb8bbe5 100644 (file)
@@ -98,7 +98,7 @@ public class SoneImpl implements LocalSone {
        private final Collection<Post> posts = new HashSet<Post>();
 
        /** All replies. */
-       private final Set<PostReply> replies = new CopyOnWriteArraySet<PostReply>();
+       private final Set<PostReply> replies = new HashSet<PostReply>();
 
        /** The IDs of all liked posts. */
        private final Set<String> likedPostIds = new CopyOnWriteArraySet<String>();
@@ -121,7 +121,7 @@ public class SoneImpl implements LocalSone {
         * @param local
         *              {@code true} if the Sone is a local Sone, {@code false} otherwise
         */
-       public SoneImpl(Database database, Identity identity, boolean local, long time, Client client, Collection<Post> posts) {
+       public SoneImpl(Database database, Identity identity, boolean local, long time, Client client, Collection<Post> posts, Collection<PostReply> postReplies) {
                this.database = database;
                this.id = identity.getId();
                this.identity = identity;
@@ -129,6 +129,7 @@ public class SoneImpl implements LocalSone {
                this.time = time;
                this.client = client;
                this.posts.addAll(posts);
+               this.replies.addAll(postReplies);
        }
 
        //