Added option to enable showing authentication errors

pull/155/head
M66B 7 years ago
parent 151c582b65
commit fe7e4b833a

@ -143,7 +143,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
private boolean preview; private boolean preview;
private boolean autohtml; private boolean autohtml;
private boolean autoimages; private boolean autoimages;
private boolean paranoid; private boolean authentication;
private boolean debug; private boolean debug;
private float textSize; private float textSize;
@ -507,7 +507,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
Boolean.FALSE.equals(message.spf) || Boolean.FALSE.equals(message.spf) ||
Boolean.FALSE.equals(message.dmarc) Boolean.FALSE.equals(message.dmarc)
? colorAccent : Color.TRANSPARENT); ? colorAccent : Color.TRANSPARENT);
vwStatus.setVisibility(paranoid ? View.VISIBLE : View.GONE); vwStatus.setVisibility(authentication ? View.VISIBLE : View.GONE);
// Expander // Expander
boolean expanded = (viewType == ViewType.THREAD && properties.getValue("expanded", message.id)); boolean expanded = (viewType == ViewType.THREAD && properties.getValue("expanded", message.id));
@ -2952,7 +2952,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
this.preview = prefs.getBoolean("preview", false); this.preview = prefs.getBoolean("preview", false);
this.autohtml = prefs.getBoolean("autohtml", false); this.autohtml = prefs.getBoolean("autohtml", false);
this.autoimages = prefs.getBoolean("autoimages", false); this.autoimages = prefs.getBoolean("autoimages", false);
this.paranoid = prefs.getBoolean("paranoid", true); this.authentication = prefs.getBoolean("authentication", false);
this.debug = prefs.getBoolean("debug", false); this.debug = prefs.getBoolean("debug", false);
this.textSize = Helper.getTextSize(context, zoom); this.textSize = Helper.getTextSize(context, zoom);

@ -105,6 +105,7 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
private SwitchCompat swLight; private SwitchCompat swLight;
private Button btnSound; private Button btnSound;
private SwitchCompat swAuthentication;
private SwitchCompat swParanoid; private SwitchCompat swParanoid;
private SwitchCompat swEnglish; private SwitchCompat swEnglish;
private SwitchCompat swUpdates; private SwitchCompat swUpdates;
@ -117,7 +118,7 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
"startup", "date", "threading", "avatars", "identicons", "name_email", "subject_italic", "flags", "preview", "startup", "date", "threading", "avatars", "identicons", "name_email", "subject_italic", "flags", "preview",
"addresses", "monospaced", "autohtml", "autoimages", "actionbar", "addresses", "monospaced", "autohtml", "autoimages", "actionbar",
"pull", "swipenav", "autoexpand", "autoclose", "autonext", "pull", "swipenav", "autoexpand", "autoclose", "autonext",
"debug" "authentication", "debug"
}; };
private final static String[] ADVANCED_OPTIONS = new String[]{ private final static String[] ADVANCED_OPTIONS = new String[]{
@ -128,7 +129,7 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
"pull", "swipenav", "autoexpand", "autoclose", "autonext", "collapse", "autoread", "automove", "pull", "swipenav", "autoexpand", "autoclose", "autonext", "collapse", "autoread", "automove",
"autoresize", "sender", "autosend", "autoresize", "sender", "autosend",
"notify_preview", "search_local", "light", "sound", "notify_preview", "search_local", "light", "sound",
"paranoid", "english", "updates", "debug", "authentication", "paranoid", "english", "updates", "debug",
"first", "why", "last_update_check", "app_support", "message_swipe", "message_select", "folder_actions", "folder_sync", "first", "why", "last_update_check", "app_support", "message_swipe", "message_select", "folder_actions", "folder_sync",
"edit_ref_confirmed", "show_html_confirmed", "show_images_confirmed", "print_html_confirmed", "show_organization", "style_toolbar" "edit_ref_confirmed", "show_html_confirmed", "show_images_confirmed", "print_html_confirmed", "show_organization", "style_toolbar"
}; };
@ -184,6 +185,7 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
swLight = view.findViewById(R.id.swLight); swLight = view.findViewById(R.id.swLight);
btnSound = view.findViewById(R.id.btnSound); btnSound = view.findViewById(R.id.btnSound);
swAuthentication = view.findViewById(R.id.swAuthentication);
swParanoid = view.findViewById(R.id.swParanoid); swParanoid = view.findViewById(R.id.swParanoid);
swEnglish = view.findViewById(R.id.swEnglish); swEnglish = view.findViewById(R.id.swEnglish);
swUpdates = view.findViewById(R.id.swUpdates); swUpdates = view.findViewById(R.id.swUpdates);
@ -251,6 +253,13 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
} }
}); });
swAuthentication.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("authentication", checked).apply();
}
});
swParanoid.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { swParanoid.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override @Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@ -656,6 +665,7 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
swNotifyPreview.setEnabled(Helper.isPro(getContext())); swNotifyPreview.setEnabled(Helper.isPro(getContext()));
swSearchLocal.setChecked(prefs.getBoolean("search_local", false)); swSearchLocal.setChecked(prefs.getBoolean("search_local", false));
swLight.setChecked(prefs.getBoolean("light", false)); swLight.setChecked(prefs.getBoolean("light", false));
swAuthentication.setChecked(prefs.getBoolean("authentication", false));
swParanoid.setChecked(prefs.getBoolean("paranoid", true)); swParanoid.setChecked(prefs.getBoolean("paranoid", true));
swEnglish.setChecked(prefs.getBoolean("english", false)); swEnglish.setChecked(prefs.getBoolean("english", false));
swUpdates.setChecked(prefs.getBoolean("updates", true)); swUpdates.setChecked(prefs.getBoolean("updates", true));

@ -853,6 +853,18 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swEnglish" /> app:layout_constraintTop_toBottomOf="@id/swEnglish" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swAuthentication"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginTop="12dp"
android:layout_marginEnd="12dp"
android:text="@string/title_advanced_authentication"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvEnglishHint"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat <androidx.appcompat.widget.SwitchCompat
android:id="@+id/swParanoid" android:id="@+id/swParanoid"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -862,7 +874,7 @@
android:layout_marginEnd="12dp" android:layout_marginEnd="12dp"
android:text="@string/title_advanced_paranoid" android:text="@string/title_advanced_paranoid"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvEnglishHint" app:layout_constraintTop_toBottomOf="@id/swAuthentication"
app:switchPadding="12dp" /> app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat <androidx.appcompat.widget.SwitchCompat

@ -194,6 +194,7 @@
<string name="title_advanced_light">Use notification light</string> <string name="title_advanced_light">Use notification light</string>
<string name="title_advanced_sound">Select notification sound</string> <string name="title_advanced_sound">Select notification sound</string>
<string name="title_advanced_english">Force English language</string> <string name="title_advanced_english">Force English language</string>
<string name="title_advanced_authentication">Show a warning when the receiving server could not authenticate the message</string>
<string name="title_advanced_paranoid">Extra privacy features</string> <string name="title_advanced_paranoid">Extra privacy features</string>
<string name="title_advanced_updates">Check for updates</string> <string name="title_advanced_updates">Check for updates</string>
<string name="title_advanced_debug">Debug mode</string> <string name="title_advanced_debug">Debug mode</string>

Loading…
Cancel
Save