Use compatibility mode when getting posts
[Sone.git] / src / main / java / net / pterodactylus / sone / data / Sone.java
index 04c5f39..7acdb7f 100644 (file)
@@ -35,6 +35,7 @@ import net.pterodactylus.sone.freenet.wot.Identity;
 import net.pterodactylus.sone.freenet.wot.OwnIdentity;
 import net.pterodactylus.sone.template.SoneAccessor;
 
+import com.google.common.base.Optional;
 import freenet.keys.FreenetURI;
 
 import com.google.common.base.Function;
@@ -171,17 +172,6 @@ public interface Sone extends Identified, Fingerprintable, Comparable<Sone> {
                }
        };
 
-       public static final Function<Sone, String> toSoneXmlUri =
-                       new Function<Sone, String>() {
-                               @Nonnull
-                               @Override
-                               public String apply(@Nullable Sone input) {
-                                       return input.getRequestUri()
-                                                       .setMetaString(new String[] { "sone.xml" })
-                                                       .toString();
-                               }
-                       };
-
        public static final Function<Sone, List<Album>> toAllAlbums = new Function<Sone, List<Album>>() {
                @Override
                public List<Album> apply(@Nullable Sone sone) {
@@ -199,6 +189,13 @@ public interface Sone extends Identified, Fingerprintable, Comparable<Sone> {
                }
        };
 
+       Function<Sone, Collection<Post>> toAllPosts = new Function<Sone, Collection<Post>>() {
+               @Override
+               public Collection<Post> apply(@Nullable Sone sone) {
+                       return (sone != null) ? sone.getPosts() : Collections.<Post>emptyList();
+               }
+       };
+
        /**
         * Returns the identity of this Sone.
         *
@@ -513,6 +510,7 @@ public interface Sone extends Identified, Fingerprintable, Comparable<Sone> {
         * @return The root album of this Sone
         */
        Album getRootAlbum();
+       Optional<Image> getImageByInternalId(final String internalId);
 
        /**
         * Returns Sone-specific options.