Revert "Require DMARC for BIMI images"

This reverts commit 7171455db7.
master
M66B 3 weeks ago
parent b18bf94eff
commit 97a962cda2

@ -1305,7 +1305,6 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
message.folderUnified && outgoing) ||
EntityFolder.isOutgoing(message.folderInheritedType));
String selector = (reverse ? null : message.bimi_selector);
boolean dmarc = (!reverse && Boolean.TRUE.equals(message.dmarc));
Address[] addresses = (reverse ? message.to : (message.isForwarder() ? message.submitter : message.from));
Address[] senders = ContactInfo.fillIn(
reverse && !show_recipients ? message.to : message.senders, prefer_contact, only_contact);
@ -1679,7 +1678,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
// Contact info
ContactInfo[] info = ContactInfo.getCached(context,
message.account, message.folderType, selector, dmarc, addresses);
message.account, message.folderType, selector, addresses);
if (info == null) {
if (taskContactInfo != null) {
taskContactInfo.cancel(context);
@ -1691,7 +1690,6 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
aargs.putLong("account", message.account);
aargs.putString("folderType", message.folderType);
aargs.putString("selector", selector);
aargs.putBoolean("dmarc", dmarc);
aargs.putSerializable("addresses", addresses);
taskContactInfo = new SimpleTask<ContactInfo[]>() {
@ -1700,9 +1698,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
long account = args.getLong("account");
String folderType = args.getString("folderType");
String selector = args.getString("selector");
boolean dmarc = args.getBoolean("dmarc");
Address[] addresses = (Address[]) args.getSerializable("addresses");
return ContactInfo.get(context, account, folderType, selector, dmarc, addresses);
return ContactInfo.get(context, account, folderType, selector, addresses);
}
@Override
@ -7602,7 +7599,6 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
args.putLong("account", message.account);
args.putString("folderType", message.folderType);
args.putString("selector", message.bimi_selector);
args.putBoolean("dmarc", Boolean.TRUE.equals(message.dmarc));
args.putSerializable("addresses", message.from);
new SimpleTask<ContactInfo[]>() {
@ -7611,9 +7607,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
long account = args.getLong("account");
String folderType = args.getString("folderType");
String selector = args.getString("selector");
boolean dmarc = args.getBoolean("dmarc");
Address[] addresses = (Address[]) args.getSerializable("addresses");
return ContactInfo.get(context, account, folderType, selector, dmarc, addresses);
return ContactInfo.get(context, account, folderType, selector, addresses);
}
@Override

@ -219,15 +219,15 @@ public class ContactInfo {
}
@NonNull
static ContactInfo[] get(Context context, long account, String folderType, String selector, boolean dmarc, Address[] addresses) {
return get(context, account, folderType, selector, dmarc, addresses, false);
static ContactInfo[] get(Context context, long account, String folderType, String selector, Address[] addresses) {
return get(context, account, folderType, selector, addresses, false);
}
static ContactInfo[] getCached(Context context, long account, String folderType, String selector, boolean dmarc, Address[] addresses) {
return get(context, account, folderType, selector, dmarc, addresses, true);
static ContactInfo[] getCached(Context context, long account, String folderType, String selector, Address[] addresses) {
return get(context, account, folderType, selector, addresses, true);
}
private static ContactInfo[] get(Context context, long account, String folderType, String selector, boolean dmarc, Address[] addresses, boolean cacheOnly) {
private static ContactInfo[] get(Context context, long account, String folderType, String selector, Address[] addresses, boolean cacheOnly) {
if (addresses == null || addresses.length == 0) {
ContactInfo anonymous = getAnonymous(context);
return new ContactInfo[]{anonymous == null ? new ContactInfo() : anonymous};
@ -235,7 +235,7 @@ public class ContactInfo {
ContactInfo[] result = new ContactInfo[addresses.length];
for (int i = 0; i < addresses.length; i++) {
result[i] = _get(context, account, folderType, selector, dmarc, (InternetAddress) addresses[i], cacheOnly);
result[i] = _get(context, account, folderType, selector, (InternetAddress) addresses[i], cacheOnly);
if (result[i] == null) {
if (cacheOnly)
return null;
@ -257,7 +257,7 @@ public class ContactInfo {
private static ContactInfo _get(
Context context,
long account, String folderType,
String selector, boolean dmarc, InternetAddress address, boolean cacheOnly) {
String selector, InternetAddress address, boolean cacheOnly) {
String key = MessageHelper.formatAddresses(new Address[]{address});
synchronized (emailContactInfo) {
ContactInfo info = emailContactInfo.get(key);
@ -277,7 +277,7 @@ public class ContactInfo {
boolean avatars = prefs.getBoolean("avatars", true);
boolean prefer_contact = prefs.getBoolean("prefer_contact", false);
boolean distinguish_contacts = prefs.getBoolean("distinguish_contacts", false);
boolean bimi = (prefs.getBoolean("bimi", false) && dmarc && !BuildConfig.PLAY_STORE_RELEASE);
boolean bimi = (prefs.getBoolean("bimi", false) && !BuildConfig.PLAY_STORE_RELEASE);
boolean gravatars = (prefs.getBoolean("gravatars", false) && !BuildConfig.PLAY_STORE_RELEASE);
boolean libravatars = (prefs.getBoolean("libravatars", false) && !BuildConfig.PLAY_STORE_RELEASE);
boolean favicons = prefs.getBoolean("favicons", false);

@ -717,8 +717,7 @@ class NotificationHelper {
latest = message.received;
ContactInfo[] info = ContactInfo.get(context,
message.account, message.folderType,
message.bimi_selector, Boolean.TRUE.equals(message.dmarc),
message.account, message.folderType, message.bimi_selector,
message.isForwarder() ? message.submitter : message.from);
Address[] modified = (message.from == null

@ -238,8 +238,7 @@ public class WidgetUnifiedRemoteViewsFactory implements RemoteViewsService.Remot
if (avatars) {
ContactInfo[] info = ContactInfo.get(context,
message.account, null,
message.bimi_selector, Boolean.TRUE.equals(message.dmarc),
message.account, null, message.bimi_selector,
message.isForwarder() ? message.submitter : message.from);
views.setImageViewBitmap(R.id.avatar, info.length == 0 ? null : info[0].getPhotoBitmap());
}

Loading…
Cancel
Save