import net.pterodactylus.sone.data.Reply;
import net.pterodactylus.sone.data.Sone;
import net.pterodactylus.sone.data.Sone.SoneStatus;
-import net.pterodactylus.sone.data.SoneOptions.ShowCustomAvatars;
+import net.pterodactylus.sone.data.SoneOptions.LoadExternalContent;
import net.pterodactylus.sone.data.TemporaryImage;
import net.pterodactylus.sone.database.AlbumBuilder;
import net.pterodactylus.sone.database.Database;
sone.getOptions().setShowNewSoneNotifications(configuration.getBooleanValue(sonePrefix + "/Options/ShowNotification/NewSones").getValue(true));
sone.getOptions().setShowNewPostNotifications(configuration.getBooleanValue(sonePrefix + "/Options/ShowNotification/NewPosts").getValue(true));
sone.getOptions().setShowNewReplyNotifications(configuration.getBooleanValue(sonePrefix + "/Options/ShowNotification/NewReplies").getValue(true));
- sone.getOptions().setShowCustomAvatars(ShowCustomAvatars.valueOf(configuration.getStringValue(sonePrefix + "/Options/ShowCustomAvatars").getValue(ShowCustomAvatars.NEVER.name())));
+ sone.getOptions().setShowCustomAvatars(LoadExternalContent.valueOf(configuration.getStringValue(sonePrefix + "/Options/ShowCustomAvatars").getValue(LoadExternalContent.NEVER.name())));
/* if we’re still here, Sone was loaded successfully. */
synchronized (sone) {
package net.pterodactylus.sone.data;
-import static net.pterodactylus.sone.data.SoneOptions.ShowCustomAvatars.NEVER;
+import static net.pterodactylus.sone.data.SoneOptions.LoadExternalContent.NEVER;
/**
* All Sone-specific options.
boolean isShowNewReplyNotifications();
void setShowNewReplyNotifications(boolean showNewReplyNotifications);
- ShowCustomAvatars getShowCustomAvatars();
- void setShowCustomAvatars(ShowCustomAvatars showCustomAvatars);
+ LoadExternalContent getShowCustomAvatars();
+ void setShowCustomAvatars(LoadExternalContent showCustomAvatars);
/**
- * The possible values for the “show custom avatars” option.
+ * Possible values for all options that are related to loading external content.
*
* @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
*/
- enum ShowCustomAvatars {
+ enum LoadExternalContent {
/** Never show custom avatars. */
NEVER,
private boolean showNewSoneNotifications = true;
private boolean showNewPostNotifications = true;
private boolean showNewReplyNotifications = true;
- private ShowCustomAvatars showCustomAvatars = NEVER;
+ private LoadExternalContent showCustomAvatars = NEVER;
@Override
public boolean isAutoFollow() {
}
@Override
- public ShowCustomAvatars getShowCustomAvatars() {
+ public LoadExternalContent getShowCustomAvatars() {
return showCustomAvatars;
}
@Override
- public void setShowCustomAvatars(ShowCustomAvatars showCustomAvatars) {
+ public void setShowCustomAvatars(LoadExternalContent showCustomAvatars) {
this.showCustomAvatars = showCustomAvatars;
}
import net.pterodactylus.sone.core.Core;
import net.pterodactylus.sone.data.Profile;
import net.pterodactylus.sone.data.Sone;
-import net.pterodactylus.sone.data.SoneOptions.ShowCustomAvatars;
+import net.pterodactylus.sone.data.SoneOptions.LoadExternalContent;
import net.pterodactylus.sone.freenet.wot.OwnIdentity;
import net.pterodactylus.sone.freenet.wot.Trust;
import net.pterodactylus.util.template.Accessor;
/* always show your own avatars. */
return avatarId;
}
- ShowCustomAvatars showCustomAvatars = currentSone.getOptions().getShowCustomAvatars();
- if (showCustomAvatars == ShowCustomAvatars.NEVER) {
+ LoadExternalContent showCustomAvatars = currentSone.getOptions().getShowCustomAvatars();
+ if (showCustomAvatars == LoadExternalContent.NEVER) {
return null;
}
- if (showCustomAvatars == ShowCustomAvatars.ALWAYS) {
+ if (showCustomAvatars == LoadExternalContent.ALWAYS) {
return avatarId;
}
- if (showCustomAvatars == ShowCustomAvatars.FOLLOWED) {
+ if (showCustomAvatars == LoadExternalContent.FOLLOWED) {
return currentSone.hasFriend(remoteSone.getId()) ? avatarId : null;
}
Trust trust = remoteSone.getIdentity().getTrust((OwnIdentity) currentSone.getIdentity());
if (trust == null) {
return null;
}
- if ((showCustomAvatars == ShowCustomAvatars.MANUALLY_TRUSTED) && (trust.getExplicit() != null) && (trust.getExplicit() > 0)) {
+ if ((showCustomAvatars == LoadExternalContent.MANUALLY_TRUSTED) && (trust.getExplicit() != null) && (trust.getExplicit() > 0)) {
return avatarId;
}
- if ((showCustomAvatars == ShowCustomAvatars.TRUSTED) && (((trust.getExplicit() != null) && (trust.getExplicit() > 0)) || ((trust.getImplicit() != null) && (trust.getImplicit() > 0)))) {
+ if ((showCustomAvatars == LoadExternalContent.TRUSTED) && (((trust.getExplicit() != null) && (trust.getExplicit() > 0)) || ((trust.getImplicit() != null) && (trust.getImplicit() > 0)))) {
return avatarId;
}
return null;
import net.pterodactylus.sone.core.Preferences;
import net.pterodactylus.sone.data.Sone;
-import net.pterodactylus.sone.data.SoneOptions.ShowCustomAvatars;
+import net.pterodactylus.sone.data.SoneOptions.LoadExternalContent;
import net.pterodactylus.sone.fcp.FcpInterface.FullAccessRequired;
import net.pterodactylus.sone.web.page.FreenetRequest;
import net.pterodactylus.util.template.Template;
boolean showNotificationNewReplies = request.getHttpRequest().isPartSet("show-notification-new-replies");
currentSone.getOptions().setShowNewReplyNotifications(showNotificationNewReplies);
String showCustomAvatars = request.getHttpRequest().getPartAsStringFailsafe("show-custom-avatars", 32);
- currentSone.getOptions().setShowCustomAvatars(ShowCustomAvatars.valueOf(showCustomAvatars));
+ currentSone.getOptions().setShowCustomAvatars(LoadExternalContent.valueOf(showCustomAvatars));
webInterface.getCore().touchConfiguration();
}
Integer insertionDelay = parseInt(request.getHttpRequest().getPartAsStringFailsafe("insertion-delay", 16), null);