From 81414b51b47cf0e7fb0966593aa9881e13c9b333 Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 23 Jan 2020 17:02:52 +0100 Subject: [PATCH] Enable Gravatars and warn about privacy risks --- .../main/java/eu/faircode/email/ContactInfo.java | 2 +- .../eu/faircode/email/FragmentOptionsDisplay.java | 12 +++++++++++- app/src/main/java/eu/faircode/email/Helper.java | 1 + .../main/res/layout/fragment_options_display.xml | 14 +++++++++++++- app/src/main/res/values/strings.xml | 1 + 5 files changed, 27 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/ContactInfo.java b/app/src/main/java/eu/faircode/email/ContactInfo.java index 4397c15bf8..b7336d550f 100644 --- a/app/src/main/java/eu/faircode/email/ContactInfo.java +++ b/app/src/main/java/eu/faircode/email/ContactInfo.java @@ -170,7 +170,7 @@ public class ContactInfo { if (info.bitmap == null) { boolean gravatars = prefs.getBoolean("gravatars", false); - if (gravatars && BuildConfig.DEBUG) { + if (gravatars) { boolean lookup; synchronized (emailGravatar) { Gravatar g = emailGravatar.get(address.getAddress()); diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsDisplay.java b/app/src/main/java/eu/faircode/email/FragmentOptionsDisplay.java index 9e304fc123..89304e9435 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsDisplay.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsDisplay.java @@ -41,6 +41,7 @@ import android.widget.ImageView; import android.widget.RadioGroup; import android.widget.SeekBar; import android.widget.Spinner; +import android.widget.TextView; import android.widget.Toast; import androidx.annotation.NonNull; @@ -62,6 +63,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer private SwitchCompat swHighlightUnread; private SwitchCompat swColorStripe; private SwitchCompat swAvatars; + private TextView tvGravatarsHint; private SwitchCompat swGravatars; private SwitchCompat swGeneratedIcons; private SwitchCompat swIdenticons; @@ -128,6 +130,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer swColorStripe = view.findViewById(R.id.swColorStripe); swAvatars = view.findViewById(R.id.swAvatars); swGravatars = view.findViewById(R.id.swGravatars); + tvGravatarsHint = view.findViewById(R.id.tvGravatarsHint); swGeneratedIcons = view.findViewById(R.id.swGeneratedIcons); swIdenticons = view.findViewById(R.id.swIdenticons); swCircular = view.findViewById(R.id.swCircular); @@ -261,6 +264,14 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer } }); + tvGravatarsHint.getPaint().setUnderlineText(true); + tvGravatarsHint.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Helper.view(getContext(), Uri.parse(Helper.GRAVATAR_PRIVACY_URI), true); + } + }); + swGeneratedIcons.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { @@ -599,7 +610,6 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer swColorStripe.setChecked(prefs.getBoolean("color_stripe", true)); swAvatars.setChecked(prefs.getBoolean("avatars", true)); swGravatars.setChecked(prefs.getBoolean("gravatars", false)); - swGravatars.setVisibility(BuildConfig.DEBUG ? View.VISIBLE : View.GONE); swGeneratedIcons.setChecked(prefs.getBoolean("generated_icons", true)); swIdenticons.setChecked(prefs.getBoolean("identicons", false)); swIdenticons.setEnabled(swGeneratedIcons.isChecked()); diff --git a/app/src/main/java/eu/faircode/email/Helper.java b/app/src/main/java/eu/faircode/email/Helper.java index 8cc61c53d6..0bc6c3734d 100644 --- a/app/src/main/java/eu/faircode/email/Helper.java +++ b/app/src/main/java/eu/faircode/email/Helper.java @@ -139,6 +139,7 @@ public class Helper { static final String SUPPORT_URI = "https://contact.faircode.eu/?product=fairemailsupport"; static final String TEST_URI = "https://play.google.com/apps/testing/" + BuildConfig.APPLICATION_ID; static final String CROWDIN_URI = "https://crowdin.com/project/open-source-email"; + static final String GRAVATAR_PRIVACY_URI = "https://meta.stackexchange.com/questions/44717/is-gravatar-a-privacy-risk"; static ExecutorService getBackgroundExecutor(int threads, String name) { ThreadFactory factory = new ThreadFactory() { diff --git a/app/src/main/res/layout/fragment_options_display.xml b/app/src/main/res/layout/fragment_options_display.xml index 0fe929ae5a..3efa8431af 100644 --- a/app/src/main/res/layout/fragment_options_display.xml +++ b/app/src/main/res/layout/fragment_options_display.xml @@ -202,6 +202,18 @@ app:layout_constraintTop_toBottomOf="@id/swAvatars" app:switchPadding="12dp" /> + + Switching to a more compact layout and changing the message text size can be done in the top action bar menu in the message view Messages are only grouped by date if they are sorted by time Group messages related to each other + There might be a privacy risk When disabled only names will be shown when available Only available when message text has been downloaded Inline images are images included in the message