Merge commit 'sone-removal-notification-200' into next
[Sone.git] / src / main / java / net / pterodactylus / sone / core / Core.java
index c480d9b..1e68c63 100644 (file)
@@ -49,6 +49,7 @@ import net.pterodactylus.sone.freenet.wot.OwnIdentity;
 import net.pterodactylus.sone.freenet.wot.Trust;
 import net.pterodactylus.sone.freenet.wot.WebOfTrustException;
 import net.pterodactylus.sone.main.SonePlugin;
+import net.pterodactylus.util.collection.Pair;
 import net.pterodactylus.util.config.Configuration;
 import net.pterodactylus.util.config.ConfigurationException;
 import net.pterodactylus.util.logging.Logging;
@@ -56,6 +57,7 @@ import net.pterodactylus.util.number.Numbers;
 import net.pterodactylus.util.validation.IntegerRangeValidator;
 import net.pterodactylus.util.validation.Validation;
 import net.pterodactylus.util.version.Version;
+import freenet.client.FetchResult;
 import freenet.keys.FreenetURI;
 
 /**
@@ -1701,6 +1703,9 @@ public class Core implements IdentityListener, UpdateListener {
                        for (SoneInserter soneInserter : soneInserters.values()) {
                                soneInserter.stop();
                        }
+                       for (Sone localSone : localSones.values()) {
+                               saveSone(localSone);
+                       }
                }
                updateChecker.stop();
                updateChecker.removeUpdateListener(this);
@@ -2032,6 +2037,7 @@ public class Core implements IdentityListener, UpdateListener {
                }
                synchronized (newSones) {
                        newSones.remove(identity.getId());
+                       coreListenerManager.fireSoneRemoved(sone);
                }
        }