From: David ‘Bombe’ Roden Date: Wed, 7 Dec 2011 06:22:52 +0000 (+0100) Subject: Add accessor that returns the avatar as Image. X-Git-Tag: 0.7.6^2~1^2~14 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=66d7b4a08dfd8b5207ff35ba99690d71e99794e5;p=Sone.git Add accessor that returns the avatar as Image. --- diff --git a/src/main/java/net/pterodactylus/sone/template/SoneAccessor.java b/src/main/java/net/pterodactylus/sone/template/SoneAccessor.java index ead6066..bc72776 100644 --- a/src/main/java/net/pterodactylus/sone/template/SoneAccessor.java +++ b/src/main/java/net/pterodactylus/sone/template/SoneAccessor.java @@ -112,6 +112,12 @@ public class SoneAccessor extends ReflectionAccessor { return new Trust(null, null, null); } return trust; + } else if (member.equals("avatar")) { + String avatarId = sone.getAvatar(); + if (avatarId == null) { + return null; + } + return core.getImage(avatarId); } return super.get(templateContext, object, member); }