mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-09 10:33:41 +02:00
Removed Gravatar support for Play store version
This commit is contained in:
@@ -287,7 +287,7 @@ public class ContactInfo {
|
||||
}
|
||||
|
||||
// Gravatar
|
||||
if (info.bitmap == null && gravatars) {
|
||||
if (info.bitmap == null && gravatars && !BuildConfig.PLAY_STORE_RELEASE) {
|
||||
if (!TextUtils.isEmpty(info.email)) {
|
||||
String gkey = info.email.toLowerCase(Locale.ROOT);
|
||||
boolean lookup;
|
||||
@@ -300,7 +300,7 @@ public class ContactInfo {
|
||||
HttpURLConnection urlConnection = null;
|
||||
try {
|
||||
String hash = Helper.md5(gkey.getBytes());
|
||||
URL url = new URL("https://www.gravatar.com/avatar/" + hash + "?d=404");
|
||||
URL url = new URL(BuildConfig.GRAVATAR_URI + hash + "?d=404");
|
||||
Log.i("Gravatar key=" + gkey + " url=" + url);
|
||||
|
||||
urlConnection = (HttpURLConnection) url.openConnection();
|
||||
|
||||
@@ -48,6 +48,7 @@ import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.widget.SwitchCompat;
|
||||
import androidx.constraintlayout.widget.Group;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
@@ -140,6 +141,8 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
|
||||
private SwitchCompat swParseClasses;
|
||||
private SwitchCompat swAuthentication;
|
||||
|
||||
private Group grpGravatars;
|
||||
|
||||
private NumberFormat NF = NumberFormat.getNumberInstance();
|
||||
|
||||
private final static String[] RESET_OPTIONS = new String[]{
|
||||
@@ -246,6 +249,8 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
|
||||
swParseClasses = view.findViewById(R.id.swParseClasses);
|
||||
swAuthentication = view.findViewById(R.id.swAuthentication);
|
||||
|
||||
grpGravatars = view.findViewById(R.id.grpGravatars);
|
||||
|
||||
setOptions();
|
||||
|
||||
// Wire controls
|
||||
@@ -877,6 +882,8 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
|
||||
: R.color.lightColorBackground_cards));
|
||||
}
|
||||
|
||||
grpGravatars.setVisibility(BuildConfig.PLAY_STORE_RELEASE ? View.GONE : View.VISIBLE);
|
||||
|
||||
PreferenceManager.getDefaultSharedPreferences(getContext()).registerOnSharedPreferenceChangeListener(this);
|
||||
|
||||
return view;
|
||||
|
||||
Reference in New Issue
Block a user