X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fdata%2FSone.java;h=901d676bc9b55df1b5f3774f85da8bc0c1ffad85;hb=14dd8f2dcddb3ebfa0618677f10fe11b8f86ecdd;hp=e36a3063f2d1ba37e7bea1e24f3edfe903079a28;hpb=8cbc1e2bc1a94d2ceb6a635389ed4791a08a4889;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/data/Sone.java b/src/main/java/net/pterodactylus/sone/data/Sone.java index e36a306..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() { @@ -147,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; @@ -173,9 +197,6 @@ public class Sone implements Fingerprintable, Comparable { /** Sone-specific options. */ private final Options options = new Options(); - /** The avatar of this Sone. */ - private volatile String avatar; - /** * Creates a new Sone. * @@ -767,34 +788,6 @@ public class Sone implements Fingerprintable, Comparable { } /** - * Returns the ID of the currently selected avatar image. - * - * @return The ID of the currently selected avatar image, or {@code null} if - * no avatar is selected. - */ - public String getAvatar() { - return avatar; - } - - /** - * Sets the avatar image. - * - * @param avatar - * The new avatar image, or {@code null} to not select an avatar - * image. - * @return This Sone - */ - public Sone setAvatar(Image avatar) { - if (avatar == null) { - this.avatar = null; - return this; - } - Validation.begin().isEqual("Image Owner", avatar.getSone(), this).check(); - this.avatar = avatar.getId(); - return this; - } - - /** * Returns Sone-specific options. * * @return The options of this Sone @@ -851,8 +844,6 @@ public class Sone implements Fingerprintable, Comparable { } fingerprint.append(')'); - fingerprint.append("Avatar(").append(avatar).append(')'); - return fingerprint.toString(); }