Use local Sones in more places where it’s appropriate.
[Sone.git] / src / main / java / net / pterodactylus / sone / core / Core.java
index 90b6e2e..6ca7372 100644 (file)
@@ -605,7 +605,7 @@ public class Core extends AbstractService implements SoneProvider, PostProvider,
         *            The own identity to create a Sone from
         * @return The added (or already existing) Sone
         */
-       public Sone addLocalSone(OwnIdentity ownIdentity) {
+       public LocalSone addLocalSone(OwnIdentity ownIdentity) {
                if (ownIdentity == null) {
                        logger.log(Level.WARNING, "Given OwnIdentity is null!");
                        return null;
@@ -637,7 +637,7 @@ public class Core extends AbstractService implements SoneProvider, PostProvider,
                        logger.log(Level.SEVERE, String.format("Could not add “Sone” context to own identity: %s", ownIdentity));
                        return null;
                }
-               Sone sone = addLocalSone(ownIdentity);
+               LocalSone sone = addLocalSone(ownIdentity);
 
                followSone(sone, "nwa8lHa271k2QvJ8aa0Ov7IHAV-DFOCFgmDt3X6BpCI");
                touchConfiguration();
@@ -670,7 +670,7 @@ public class Core extends AbstractService implements SoneProvider, PostProvider,
                        sone.setKnown(!newSone);
                        if (newSone) {
                                eventBus.post(new NewSoneFoundEvent(sone));
-                               for (Sone localSone : getLocalSones()) {
+                               for (LocalSone localSone : getLocalSones()) {
                                        if (localSone.getOptions().isAutoFollow()) {
                                                followSone(localSone, sone.getId());
                                        }
@@ -691,7 +691,7 @@ public class Core extends AbstractService implements SoneProvider, PostProvider,
         * @param soneId
         *            The ID of the Sone to follow
         */
-       public void followSone(Sone sone, String soneId) {
+       public void followSone(LocalSone sone, String soneId) {
                checkNotNull(sone, "sone must not be null");
                checkNotNull(soneId, "soneId must not be null");
                database.addFriend(sone, soneId);
@@ -726,7 +726,7 @@ public class Core extends AbstractService implements SoneProvider, PostProvider,
         * @param soneId
         *            The ID of the Sone being unfollowed
         */
-       public void unfollowSone(Sone sone, String soneId) {
+       public void unfollowSone(LocalSone sone, String soneId) {
                checkNotNull(sone, "sone must not be null");
                checkNotNull(soneId, "soneId must not be null");
                database.removeFriend(sone, soneId);