X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ftemplate%2FSoneAccessor.java;h=a9ee78bd35642a17aca97e655aa0a0a6718da568;hb=6f1e7806171eb6af95c8669f2ac0801e34b9246a;hp=bb033068db3be2dedb2881cfc19114c7bc0d678a;hpb=9d6e64f8548fd45e06a492d0b92099c27fddd378;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 bb03306..a9ee78b 100644 --- a/src/main/java/net/pterodactylus/sone/template/SoneAccessor.java +++ b/src/main/java/net/pterodactylus/sone/template/SoneAccessor.java @@ -69,19 +69,14 @@ public class SoneAccessor extends ReflectionAccessor { return sone.getInsertUri() != null; } else if (member.equals("friend")) { Sone currentSone = (Sone) dataProvider.getData("currentSone"); - return (currentSone != null) && currentSone.hasFriend(sone); + return (currentSone != null) && currentSone.hasFriend(sone.getId()); } else if (member.equals("current")) { Sone currentSone = (Sone) dataProvider.getData("currentSone"); return (currentSone != null) && currentSone.equals(sone); - } else if (member.equals("blocked")) { - Sone currentSone = (Sone) dataProvider.getData("currentSone"); - return (currentSone != null) && currentSone.isSoneBlocked(sone.getId()); - } else if (member.equals("blacklisted")) { - return core.isBlacklistedSone(sone); } else if (member.equals("modified")) { return sone.getModificationCounter() > 0; } else if (member.equals("status")) { - return core.getSoneStatus(sone).toString(); + return core.getSoneStatus(sone); } else if (member.equals("unknown")) { return core.getSoneStatus(sone) == SoneStatus.unknown; } else if (member.equals("idle")) { @@ -90,6 +85,8 @@ public class SoneAccessor extends ReflectionAccessor { return core.getSoneStatus(sone) == SoneStatus.inserting; } else if (member.equals("downloading")) { return core.getSoneStatus(sone) == SoneStatus.downloading; + } else if (member.equals("new")) { + return core.isNewSone(sone); } return super.get(dataProvider, object, member); } @@ -112,7 +109,7 @@ public class SoneAccessor extends ReflectionAccessor { String lastName = profile.getLastName(); if (firstName == null) { if (lastName == null) { - return sone.getName(); + return String.valueOf(sone.getName()); } return lastName; }