From: David ‘Bombe’ Roden Date: Sun, 14 Nov 2010 16:10:36 +0000 (+0100) Subject: Fire a “new Sone found” event when a new Sone is found. X-Git-Tag: 0.3-RC1~74 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=a6601fb1de49f42c26eccb9dff5c07a17feceafc;p=Sone.git Fire a “new Sone found” event when a new Sone is found. --- diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index 2f69bee..2894945 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -679,7 +679,13 @@ public class Core implements IdentityListener { sone.setLatestEdition(Numbers.safeParseLong(identity.getProperty("Sone.LatestEdition"), (long) 0)); if (newSone) { synchronized (newSones) { - newSones.add(sone.getId()); + newSone = !knownSones.contains(sone.getId()); + if (newSone) { + newSones.add(sone.getId()); + } + } + if (newSone) { + coreListenerManager.fireNewSoneFound(sone); } } remoteSones.put(identity.getId(), sone);