From d9bf6bfb76e9f59c9b2364af44902e5d1210168f Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 12 Sep 2012 07:48:04 +0200 Subject: [PATCH] Get the trust directly from the identity. --- src/main/java/net/pterodactylus/sone/template/ProfileAccessor.java | 3 ++- src/main/java/net/pterodactylus/sone/template/SoneAccessor.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/pterodactylus/sone/template/ProfileAccessor.java b/src/main/java/net/pterodactylus/sone/template/ProfileAccessor.java index 1f29b65..f004967 100644 --- a/src/main/java/net/pterodactylus/sone/template/ProfileAccessor.java +++ b/src/main/java/net/pterodactylus/sone/template/ProfileAccessor.java @@ -21,6 +21,7 @@ import net.pterodactylus.sone.core.Core; import net.pterodactylus.sone.data.Profile; import net.pterodactylus.sone.data.Sone; import net.pterodactylus.sone.data.Sone.ShowCustomAvatars; +import net.pterodactylus.sone.freenet.wot.OwnIdentity; import net.pterodactylus.sone.freenet.wot.Trust; import net.pterodactylus.util.template.Accessor; import net.pterodactylus.util.template.ReflectionAccessor; @@ -83,7 +84,7 @@ public class ProfileAccessor extends ReflectionAccessor { if (showCustomAvatars == ShowCustomAvatars.FOLLOWED) { return currentSone.hasFriend(remoteSone.getId()) ? avatarId : null; } - Trust trust = core.getTrust(currentSone, remoteSone); + Trust trust = remoteSone.getIdentity().getTrust((OwnIdentity) currentSone.getIdentity()); if (trust == null) { return null; } diff --git a/src/main/java/net/pterodactylus/sone/template/SoneAccessor.java b/src/main/java/net/pterodactylus/sone/template/SoneAccessor.java index eac8a93..eca8654 100644 --- a/src/main/java/net/pterodactylus/sone/template/SoneAccessor.java +++ b/src/main/java/net/pterodactylus/sone/template/SoneAccessor.java @@ -24,6 +24,7 @@ import net.pterodactylus.sone.core.Core; import net.pterodactylus.sone.data.Profile; import net.pterodactylus.sone.data.Sone; import net.pterodactylus.sone.data.Sone.SoneStatus; +import net.pterodactylus.sone.freenet.wot.OwnIdentity; import net.pterodactylus.sone.freenet.wot.Trust; import net.pterodactylus.sone.web.WebInterface; import net.pterodactylus.sone.web.ajax.GetTimesAjaxPage; @@ -106,7 +107,7 @@ public class SoneAccessor extends ReflectionAccessor { if (currentSone == null) { return null; } - Trust trust = core.getTrust(currentSone, sone); + Trust trust = sone.getIdentity().getTrust((OwnIdentity) currentSone.getIdentity()); logger.log(Level.FINEST, String.format("Trust for %s by %s: %s", sone, currentSone, trust)); if (trust == null) { return new Trust(null, null, null); -- 2.7.4