mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-21 21:57:19 +00:00
Added option to check VMC certificate
This commit is contained in:
parent
7a476d777d
commit
d2b9be32d8
4 changed files with 35 additions and 3 deletions
|
@ -270,6 +270,7 @@ public class ContactInfo {
|
|||
boolean avatars = prefs.getBoolean("avatars", true);
|
||||
boolean gravatars = prefs.getBoolean("gravatars", false);
|
||||
boolean bimi = prefs.getBoolean("bimi", false);
|
||||
boolean bimi_vmc = prefs.getBoolean("bimi_vmc", false);
|
||||
boolean favicons = prefs.getBoolean("favicons", false);
|
||||
boolean generated = prefs.getBoolean("generated_icons", true);
|
||||
boolean identicons = prefs.getBoolean("identicons", false);
|
||||
|
@ -415,7 +416,7 @@ public class ContactInfo {
|
|||
Log.i("BIMI got TXT=" + bimi[0].name);
|
||||
|
||||
Bitmap bitmap = null;
|
||||
boolean verified = false;
|
||||
boolean verified = !bimi_vmc;
|
||||
String[] params = bimi[0].name.split(";");
|
||||
for (String param : params) {
|
||||
String[] kv = param.split("=");
|
||||
|
@ -428,6 +429,9 @@ public class ContactInfo {
|
|||
break;
|
||||
|
||||
case "l": { // Image link
|
||||
if (!bimi_vmc)
|
||||
continue;
|
||||
|
||||
String svg = kv[1].trim();
|
||||
if (TextUtils.isEmpty(svg))
|
||||
continue;
|
||||
|
|
|
@ -88,6 +88,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
|
|||
private TextView tvGravatarsHint;
|
||||
private SwitchCompat swGravatars;
|
||||
private SwitchCompat swBimi;
|
||||
private SwitchCompat swBimiVmc;
|
||||
private ImageButton ibBimi;
|
||||
private SwitchCompat swFavicons;
|
||||
private TextView tvFaviconsHint;
|
||||
|
@ -155,7 +156,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
|
|||
"date", "date_bold", "navbar_colorize", "portrait2", "landscape", "landscape3",
|
||||
"threading", "threading_unread", "indentation", "seekbar", "actionbar", "actionbar_color",
|
||||
"highlight_unread", "highlight_color", "color_stripe",
|
||||
"avatars", "gravatars", "bimi", "favicons", "generated_icons", "identicons", "circular", "saturation", "brightness", "threshold",
|
||||
"avatars", "gravatars", "bimi", "bimi_vmc", "favicons", "generated_icons", "identicons", "circular", "saturation", "brightness", "threshold",
|
||||
"email_format", "prefer_contact", "only_contact", "distinguish_contacts", "show_recipients",
|
||||
"subject_top", "font_size_sender", "font_size_subject", "subject_italic", "highlight_subject", "subject_ellipsize",
|
||||
"keywords_header", "labels_header", "flags", "flags_background",
|
||||
|
@ -204,6 +205,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
|
|||
swGravatars = view.findViewById(R.id.swGravatars);
|
||||
tvGravatarsHint = view.findViewById(R.id.tvGravatarsHint);
|
||||
swBimi = view.findViewById(R.id.swBimi);
|
||||
swBimiVmc = view.findViewById(R.id.swBimiVmc);
|
||||
ibBimi = view.findViewById(R.id.ibBimi);
|
||||
swFavicons = view.findViewById(R.id.swFavicons);
|
||||
tvFaviconsHint = view.findViewById(R.id.tvFaviconsHint);
|
||||
|
@ -488,6 +490,15 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
|
|||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
prefs.edit().putBoolean("bimi", checked).apply();
|
||||
swBimiVmc.setEnabled(checked);
|
||||
ContactInfo.clearCache(getContext());
|
||||
}
|
||||
});
|
||||
|
||||
swBimiVmc.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
prefs.edit().putBoolean("bimi_vmc", checked).apply();
|
||||
ContactInfo.clearCache(getContext());
|
||||
}
|
||||
});
|
||||
|
@ -1018,6 +1029,8 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
|
|||
swAvatars.setChecked(prefs.getBoolean("avatars", true));
|
||||
swGravatars.setChecked(prefs.getBoolean("gravatars", false));
|
||||
swBimi.setChecked(prefs.getBoolean("bimi", false));
|
||||
swBimiVmc.setChecked(prefs.getBoolean("bimi_vmc", false));
|
||||
swBimiVmc.setEnabled(swBimi.isChecked());
|
||||
swFavicons.setChecked(prefs.getBoolean("favicons", false));
|
||||
swGeneratedIcons.setChecked(prefs.getBoolean("generated_icons", true));
|
||||
swIdenticons.setChecked(prefs.getBoolean("identicons", false));
|
||||
|
|
|
@ -521,14 +521,28 @@
|
|||
app:layout_constraintTop_toBottomOf="@id/tvGravatarsHint"
|
||||
app:switchPadding="12dp" />
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:id="@+id/swBimiVmc"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:text="@string/title_advanced_bimi_vmc"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/swBimi"
|
||||
app:switchPadding="12dp" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/ibBimi"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:contentDescription="@string/title_info"
|
||||
android:tooltipText="@string/title_info"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/swBimi"
|
||||
app:layout_constraintTop_toBottomOf="@+id/swBimiVmc"
|
||||
app:srcCompat="@drawable/twotone_info_24" />
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
|
|
|
@ -397,6 +397,7 @@
|
|||
<string name="title_advanced_avatars">Show contact photos</string>
|
||||
<string name="title_advanced_gravatars">Show Gravatars</string>
|
||||
<string name="title_advanced_bimi" translatable="false">Show Brand Indicators for Message Identification (BIMI)</string>
|
||||
<string name="title_advanced_bimi_vmc">Check security certificate</string>
|
||||
<string name="title_advanced_favicons">Show favicons</string>
|
||||
<string name="title_advanced_generated_icons">Show generated icons</string>
|
||||
<string name="title_advanced_identicons">Show identicons</string>
|
||||
|
|
Loading…
Reference in a new issue