X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fdata%2FSone.java;h=901d676bc9b55df1b5f3774f85da8bc0c1ffad85;hp=006765a4261a5ae74cc0b0ac49316db8e0a2b576;hb=90179865f79eae0c8cf5726c21dab488fcd5be45;hpb=bb34588a1b7a80a2a98574d9b928f1131ab88a79 diff --git a/src/main/java/net/pterodactylus/sone/data/Sone.java b/src/main/java/net/pterodactylus/sone/data/Sone.java index 006765a..901d676 100644 --- a/src/main/java/net/pterodactylus/sone/data/Sone.java +++ b/src/main/java/net/pterodactylus/sone/data/Sone.java @@ -47,6 +47,30 @@ import freenet.keys.FreenetURI; */ public class Sone implements Fingerprintable, Comparable { + /** + * The possible values for the “show custom avatars” option. + * + * @author David ‘Bombe’ Roden + */ + public static enum ShowCustomAvatars { + + /** Never show custom avatars. */ + NEVER, + + /** Only show custom avatars of followed Sones. */ + FOLLOWED, + + /** Only show custom avatars of Sones you manually trust. */ + MANUALLY_TRUSTED, + + /** Only show custom avatars of automatically trusted Sones. */ + TRUSTED, + + /** Always show custom avatars. */ + ALWAYS, + + } + /** comparator that sorts Sones by their nice name. */ public static final Comparator NICE_NAME_COMPARATOR = new Comparator() { @@ -115,6 +139,15 @@ public class Sone implements Fingerprintable, Comparable { }; + /** Filter that matches Sones that have at least one album. */ + public static final Filter HAS_ALBUM_FILTER = new Filter() { + + @Override + public boolean filterObject(Sone sone) { + return !sone.getAlbums().isEmpty(); + } + }; + /** The logger. */ private static final Logger logger = Logging.getLogger(Sone.class); @@ -138,7 +171,7 @@ public class Sone implements Fingerprintable, Comparable { private volatile long time; /** The profile of this Sone. */ - private volatile Profile profile = new Profile(); + private volatile Profile profile = new Profile(this); /** The client used by the Sone. */ private volatile Client client;