/*
- * Sone - SoneAccessor.java - Copyright © 2010–2012 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
package net.pterodactylus.sone.template;
+import static com.google.common.collect.FluentIterable.from;
+import static java.util.Arrays.asList;
+import static net.pterodactylus.sone.data.Album.FLATTENER;
+import static net.pterodactylus.sone.data.Album.IMAGES;
+
import java.util.logging.Level;
import java.util.logging.Logger;
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());
return new Trust(null, null, null);
}
return trust;
+ } else if (member.equals("allImages")) {
+ return from(asList(sone.getRootAlbum())).transformAndConcat(FLATTENER).transformAndConcat(IMAGES);
+ } else if (member.equals("albums")) {
+ return sone.getRootAlbum().getAlbums();
}
return super.get(templateContext, object, member);
}