From: David ‘Bombe’ Roden Date: Mon, 13 Dec 2010 19:17:13 +0000 (+0100) Subject: Fire events when locking and unlocking Sones. X-Git-Tag: beta-freefall-0.6.2-1~188^2~1 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=40e59c4c4e19798504530ad7581872bfbc3627cf;p=Sone.git Fire events when locking and unlocking Sones. --- diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index 9eba2b7..2ef2d57 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -710,7 +710,9 @@ public class Core implements IdentityListener { */ public void lockSone(Sone sone) { synchronized (lockedSones) { - lockedSones.add(sone); + if (lockedSones.add(sone)) { + coreListenerManager.fireSoneLocked(sone); + } } } @@ -723,7 +725,9 @@ public class Core implements IdentityListener { */ public void unlockSone(Sone sone) { synchronized (lockedSones) { - lockedSones.remove(sone); + if (lockedSones.remove(sone)) { + coreListenerManager.fireSoneUnlocked(sone); + } } }