From 858555f647a1c39b2a6707192bdb8f32107aa5dd Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Fri, 5 Dec 2014 07:00:26 +0100 Subject: [PATCH] Use local Sones for adding friends. --- src/main/java/net/pterodactylus/sone/database/FriendProvider.java | 5 +++-- .../java/net/pterodactylus/sone/database/memory/MemoryDatabase.java | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/pterodactylus/sone/database/FriendProvider.java b/src/main/java/net/pterodactylus/sone/database/FriendProvider.java index 3665d1b..7583c77 100644 --- a/src/main/java/net/pterodactylus/sone/database/FriendProvider.java +++ b/src/main/java/net/pterodactylus/sone/database/FriendProvider.java @@ -2,6 +2,7 @@ package net.pterodactylus.sone.database; import java.util.Collection; +import net.pterodactylus.sone.data.LocalSone; import net.pterodactylus.sone.data.Sone; /** @@ -11,7 +12,7 @@ import net.pterodactylus.sone.data.Sone; */ public interface FriendProvider { - Collection getFriends(Sone localSone); - boolean isFriend(Sone localSone, String friendSoneId); + Collection getFriends(LocalSone localSone); + boolean isFriend(LocalSone localSone, String friendSoneId); } diff --git a/src/main/java/net/pterodactylus/sone/database/memory/MemoryDatabase.java b/src/main/java/net/pterodactylus/sone/database/memory/MemoryDatabase.java index 7a548b9..bfea5e2 100644 --- a/src/main/java/net/pterodactylus/sone/database/memory/MemoryDatabase.java +++ b/src/main/java/net/pterodactylus/sone/database/memory/MemoryDatabase.java @@ -624,7 +624,7 @@ public class MemoryDatabase extends AbstractService implements Database { } @Override - public Collection getFriends(Sone localSone) { + public Collection getFriends(LocalSone localSone) { if (!localSone.isLocal()) { return Collections.emptySet(); } @@ -632,7 +632,7 @@ public class MemoryDatabase extends AbstractService implements Database { } @Override - public boolean isFriend(Sone localSone, String friendSoneId) { + public boolean isFriend(LocalSone localSone, String friendSoneId) { if (!localSone.isLocal()) { return false; } -- 2.7.4