From: David ‘Bombe’ Roden Date: Sat, 1 Nov 2014 12:59:47 +0000 (+0100) Subject: Remove Sone from database correctly. X-Git-Tag: 0.9-rc1^2~3^2~63 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=a108af80df7846c28e24e59e5710bee69627483b;p=Sone.git Remove Sone from database correctly. --- diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index 14327bd..87f59c2 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -926,10 +926,9 @@ public class Core extends AbstractService implements SoneProvider, PostProvider, logger.log(Level.WARNING, String.format("Tried to delete non-local Sone: %s", sone)); return; } - // FIXME – implement in database -// sones.remove(sone.getId()); SoneInserter soneInserter = soneInserters.remove(sone); soneInserter.stop(); + database.removeSone(sone); webOfTrustUpdater.removeContext((OwnIdentity) sone.getIdentity(), "Sone"); webOfTrustUpdater.removeProperty((OwnIdentity) sone.getIdentity(), "Sone.LatestEdition"); try { @@ -1761,16 +1760,7 @@ public class Core extends AbstractService implements SoneProvider, PostProvider, /* TODO - we don’t have the Sone anymore. should this happen? */ return; } - database.removePosts(sone.get()); - for (Post post : sone.get().getPosts()) { - eventBus.post(new PostRemovedEvent(post)); - } - database.removePostReplies(sone.get()); - for (PostReply reply : sone.get().getReplies()) { - eventBus.post(new PostReplyRemovedEvent(reply)); - } -// TODO – implement in database -// sones.remove(identity.getId()); + database.removeSone(sone.get()); eventBus.post(new SoneRemovedEvent(sone.get())); }