Require a local Sone when rescuing.
[Sone.git] / src / main / java / net / pterodactylus / sone / core / Core.java
index b485445..84e7499 100644 (file)
@@ -156,7 +156,7 @@ public class Core extends AbstractService implements SoneProvider, PostProvider,
 
        /** Sone rescuers. */
        /* synchronize access on this on sones. */
-       private final Map<Sone, SoneRescuer> soneRescuers = new HashMap<Sone, SoneRescuer>();
+       private final Map<LocalSone, SoneRescuer> soneRescuers = new HashMap<LocalSone, SoneRescuer>();
 
        /** All known Sones. */
        private final Set<String> knownSones = new HashSet<String>();
@@ -269,9 +269,8 @@ public class Core extends AbstractService implements SoneProvider, PostProvider,
         *            The local Sone to get the rescuer for
         * @return The Sone rescuer for the given Sone
         */
-       public SoneRescuer getSoneRescuer(Sone sone) {
+       public SoneRescuer getSoneRescuer(LocalSone sone) {
                checkNotNull(sone, "sone must not be null");
-               checkArgument(sone.isLocal(), "sone must be local");
                synchronized (soneRescuers) {
                        SoneRescuer soneRescuer = soneRescuers.get(sone);
                        if (soneRescuer == null) {