From: David ‘Bombe’ Roden Date: Thu, 14 Feb 2013 05:40:06 +0000 (+0100) Subject: Remove all post replies of the given Sone before storing the new post replies. X-Git-Tag: 0.8.5^2~3^2~8 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=c1eb83f20e772ece19a173f26f28c4a810249679;p=Sone.git Remove all post replies of the given Sone before storing the new post replies. --- diff --git a/src/main/java/net/pterodactylus/sone/database/memory/MemoryDatabase.java b/src/main/java/net/pterodactylus/sone/database/memory/MemoryDatabase.java index 2f77eed..6e5546b 100644 --- a/src/main/java/net/pterodactylus/sone/database/memory/MemoryDatabase.java +++ b/src/main/java/net/pterodactylus/sone/database/memory/MemoryDatabase.java @@ -377,6 +377,10 @@ public class MemoryDatabase extends AbstractService implements Database { lock.writeLock().lock(); try { + /* remove all post replies of the Sone. */ + for (PostReply postReply : getRepliesFrom(sone.getId())) { + removePostReply(postReply); + } for (PostReply postReply : postReplies) { allPostReplies.put(postReply.getId(), postReply); if (this.postReplies.containsKey(postReply.getPostId())) {