Check BIMI version

pull/200/head
M66B 3 years ago
parent 410cb5be28
commit e0ba5d7147

@ -409,6 +409,7 @@ public class ContactInfo {
futures.add(executorFavicon.submit(new Callable<Favicon>() { futures.add(executorFavicon.submit(new Callable<Favicon>() {
@Override @Override
public Favicon call() throws Exception { public Favicon call() throws Exception {
// TODO: BIMI selector
final String txt = "default._bimi." + _domain; final String txt = "default._bimi." + _domain;
Log.i("BIMI fetch TXT=" + txt); Log.i("BIMI fetch TXT=" + txt);
DnsHelper.DnsRecord[] bimi = DnsHelper.lookup(context, txt, "txt"); DnsHelper.DnsRecord[] bimi = DnsHelper.lookup(context, txt, "txt");
@ -425,9 +426,12 @@ public class ContactInfo {
continue; continue;
switch (kv[0].trim().toLowerCase()) { switch (kv[0].trim().toLowerCase()) {
case "v": // Version case "v": { // Version
// TODO: check version String version = kv[1].trim();
if (!"BIMI1".equalsIgnoreCase(version))
Log.w("BIMI unsupported version=" + version);
break; break;
}
case "l": { // Image link case "l": { // Image link
if (!bimi_vmc) if (!bimi_vmc)
@ -459,7 +463,7 @@ public class ContactInfo {
break; break;
} }
case "a": // Certificate link case "a": { // Certificate link
String a = kv[1].trim(); String a = kv[1].trim();
if (TextUtils.isEmpty(a)) if (TextUtils.isEmpty(a))
continue; continue;
@ -557,6 +561,7 @@ public class ContactInfo {
Log.w(new Throwable("BIMI", ex)); Log.w(new Throwable("BIMI", ex));
} }
break; break;
}
} }
} }

Loading…
Cancel
Save