- Sone currentSone = (Sone) dataProvider.getData("currentSone");
- return currentSone.hasFriend(sone) ? true : null;
- } else if (member.equals("isCurrent")) {
- Sone currentSone = (Sone) dataProvider.getData("currentSone");
- return currentSone.equals(sone);
- } else if (member.equals("blocked")) {
- Sone currentSone = (Sone) dataProvider.getData("currentSone");
- return currentSone.isSoneBlocked(sone.getId());
+ Sone currentSone = (Sone) templateContext.get("currentSone");
+ return (currentSone != null) && currentSone.hasFriend(sone.getId());
+ } else if (member.equals("current")) {
+ Sone currentSone = (Sone) templateContext.get("currentSone");
+ return (currentSone != null) && currentSone.equals(sone);
+ } else if (member.equals("modified")) {
+ return core.isModifiedSone(sone);
+ } else if (member.equals("status")) {
+ return core.getSoneStatus(sone);
+ } else if (member.equals("unknown")) {
+ return core.getSoneStatus(sone) == SoneStatus.unknown;
+ } else if (member.equals("idle")) {
+ return core.getSoneStatus(sone) == SoneStatus.idle;
+ } else if (member.equals("inserting")) {
+ 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.getId());
+ } else if (member.equals("locked")) {
+ return core.isLocked(sone);
+ } else if (member.equals("lastUpdatedText")) {
+ return GetTimesAjaxPage.getTime((WebInterface) templateContext.get("webInterface"), System.currentTimeMillis() - sone.getTime());
+ } else if (member.equals("trust")) {
+ Sone currentSone = (Sone) templateContext.get("currentSone");
+ 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 });
+ if (trust == null) {
+ return new Trust(null, null, null);
+ }
+ return trust;