diff --git a/app/src/main/java/com/indieweb/indigenous/indieweb/micropub/IndieWebPost.java b/app/src/main/java/com/indieweb/indigenous/indieweb/micropub/IndieWebPost.java index d549c42c..59ec43bb 100644 --- a/app/src/main/java/com/indieweb/indigenous/indieweb/micropub/IndieWebPost.java +++ b/app/src/main/java/com/indieweb/indigenous/indieweb/micropub/IndieWebPost.java @@ -40,7 +40,10 @@ public boolean supports(String feature) { case FEATURE_SPOILER: case FEATURE_MEDIA_UPLOAD_DESCRIPTION: supported = false; - break; + break; + case FEATURE_POST_SENSITIVITY: + supported = Preferences.getPreference(getContext(), "pref_key_post_sensitivity", false); + break; } return supported; diff --git a/app/src/main/java/com/indieweb/indigenous/pixelfed/PixelfedPost.java b/app/src/main/java/com/indieweb/indigenous/pixelfed/PixelfedPost.java index ed423b3a..8bee9b7c 100644 --- a/app/src/main/java/com/indieweb/indigenous/pixelfed/PixelfedPost.java +++ b/app/src/main/java/com/indieweb/indigenous/pixelfed/PixelfedPost.java @@ -64,6 +64,7 @@ public boolean supports(String feature) { case FEATURE_LOCATION: case FEATURE_POST_STATUS: case FEATURE_SPOILER: + case FEATURE_POST_SENSITIVITY: supported = false; } diff --git a/app/src/main/java/com/indieweb/indigenous/post/BaseCreate.java b/app/src/main/java/com/indieweb/indigenous/post/BaseCreate.java index b4c99f00..e98c2a81 100644 --- a/app/src/main/java/com/indieweb/indigenous/post/BaseCreate.java +++ b/app/src/main/java/com/indieweb/indigenous/post/BaseCreate.java @@ -113,7 +113,7 @@ public void onClick(DialogInterface dialog, int index) { } sensitivity = findViewById(R.id.postSensitivity); - if (sensitivity != null && Preferences.getPreference(getApplicationContext(), "pref_key_post_sensitivity", false)) { + if (sensitivity != null && post.supports(Post.FEATURE_POST_SENSITIVITY)) { sensitivity.setVisibility(View.VISIBLE); } diff --git a/app/src/main/java/com/indieweb/indigenous/post/Post.java b/app/src/main/java/com/indieweb/indigenous/post/Post.java index 7aa1b5fd..ae3f458a 100644 --- a/app/src/main/java/com/indieweb/indigenous/post/Post.java +++ b/app/src/main/java/com/indieweb/indigenous/post/Post.java @@ -12,6 +12,7 @@ public interface Post { String FEATURE_AUDIO = "FEATURE_POST_AUDIO"; String FEATURE_LOCATION = "FEATURE_POST_LOCATION"; String FEATURE_POST_STATUS = "FEATURE_POST_STATUS"; + String FEATURE_POST_SENSITIVITY = "FEATURE_POST_SENSITIVITY"; String FEATURE_MEDIA_UPLOAD_DESCRIPTION = "FEATURE_MEDIA_UPLOAD_DESCRIPTION"; String FEATURE_SPOILER = "FEATURE_POST_SPOILER"; String POST_PARAM_H = "h"; diff --git a/app/src/main/java/com/indieweb/indigenous/util/Utility.java b/app/src/main/java/com/indieweb/indigenous/util/Utility.java index a90337df..22b95004 100644 --- a/app/src/main/java/com/indieweb/indigenous/util/Utility.java +++ b/app/src/main/java/com/indieweb/indigenous/util/Utility.java @@ -423,6 +423,7 @@ public static String parseNetworkError(VolleyError error, Context context, int n if (networkResponse != null && networkResponse.statusCode != 0 && networkResponse.data != null) { int code = networkResponse.statusCode; String result = new String(networkResponse.data).trim(); + //Log.d("indigenous_debug", "Error: " + result); returnMessage = String.format(context.getString(network_fail), code, result); } }