mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-02 07:06:18 +02:00
Get lookup URIs on sync
This commit is contained in:
@@ -490,8 +490,7 @@ public class ServiceSynchronize extends LifecycleService {
|
||||
// Get contact info
|
||||
Map<TupleMessageEx, ContactInfo> messageContact = new HashMap<>();
|
||||
for (TupleMessageEx message : messages)
|
||||
messageContact.put(message,
|
||||
ContactInfo.get(this, message.from, false));
|
||||
messageContact.put(message, ContactInfo.get(this, message.from, false));
|
||||
|
||||
// Build pending intent
|
||||
Intent view = new Intent(this, ActivityView.class);
|
||||
@@ -2673,6 +2672,9 @@ public class ServiceSynchronize extends LifecycleService {
|
||||
message.ui_ignored = seen;
|
||||
message.ui_browsed = browsed;
|
||||
|
||||
Uri lookupUri = ContactInfo.getLookupUri(context, message.from);
|
||||
message.avatar = (lookupUri == null ? null : lookupUri.toString());
|
||||
|
||||
// Check sender
|
||||
Address sender = helper.getSender();
|
||||
if (sender != null && senders.length > 0) {
|
||||
@@ -2747,6 +2749,15 @@ public class ServiceSynchronize extends LifecycleService {
|
||||
Log.i(folder.name + " updated id=" + message.id + " uid=" + message.uid + " unbrowse");
|
||||
}
|
||||
|
||||
if (message.avatar == null) {
|
||||
Uri lookupUri = ContactInfo.getLookupUri(context, message.from);
|
||||
if (lookupUri != null) {
|
||||
update = true;
|
||||
message.avatar = lookupUri.toString();
|
||||
Log.i(folder.name + " updated id=" + message.id + " lookup=" + lookupUri);
|
||||
}
|
||||
}
|
||||
|
||||
if (update)
|
||||
db.message().updateMessage(message);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user