X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ftemplate%2FSoneAccessor.java;h=c54fc0d80d106d0ae641dc0f18731d8c9f10594c;hb=d5efb086bee8f103cbe90c7a953ffbb7ff27b689;hp=305e9a8114910ae96197007e36ae5dc382887a36;hpb=4314a29fdeb9766e198b7144a9724422d0df84dc;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/template/SoneAccessor.java b/src/main/java/net/pterodactylus/sone/template/SoneAccessor.java index 305e9a8..c54fc0d 100644 --- a/src/main/java/net/pterodactylus/sone/template/SoneAccessor.java +++ b/src/main/java/net/pterodactylus/sone/template/SoneAccessor.java @@ -1,5 +1,5 @@ /* - * Sone - SoneAccessor.java - Copyright © 2010 David Roden + * Sone - SoneAccessor.java - Copyright © 2010–2013 David Roden * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -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; @@ -75,8 +76,6 @@ public class SoneAccessor extends ReflectionAccessor { Sone sone = (Sone) object; if (member.equals("niceName")) { return getNiceName(sone); - } else if (member.equals("local")) { - return core.isLocalSone(sone); } else if (member.equals("friend")) { Sone currentSone = (Sone) templateContext.get("currentSone"); return (currentSone != null) && currentSone.hasFriend(sone.getId()); @@ -96,7 +95,7 @@ public class SoneAccessor extends ReflectionAccessor { } else if (member.equals("downloading")) { return sone.getStatus() == SoneStatus.downloading; } else if (member.equals("new")) { - return core.isNewSone(sone.getId()); + return !sone.isKnown(); } else if (member.equals("locked")) { return core.isLocked(sone); } else if (member.equals("lastUpdatedText")) { @@ -106,8 +105,8 @@ public class SoneAccessor extends ReflectionAccessor { if (currentSone == null) { return null; } - Trust trust = core.getTrust(currentSone, sone); - logger.log(Level.FINEST, "Trust for %s by %s: %s", new Object[] { sone, currentSone, trust }); + 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); }