Prevent resetting avatars

This can happen when revoking contacts permissions
This commit is contained in:
M66B 2020-04-15 20:26:04 +02:00
parent f1e9b23a96
commit a3b64e796e
1 changed files with 7 additions and 5 deletions

View File

@ -2522,11 +2522,13 @@ class Core {
} }
Uri uri = ContactInfo.getLookupUri(context, message.from); Uri uri = ContactInfo.getLookupUri(context, message.from);
String avatar = (uri == null ? null : uri.toString()); if (uri != null) {
if (!Objects.equals(message.avatar, avatar)) { String avatar = uri.toString();
update = true; if (!Objects.equals(message.avatar, avatar)) {
message.avatar = avatar; update = true;
Log.i(folder.name + " updated id=" + message.id + " uid=" + message.uid + " avatar=" + avatar); message.avatar = avatar;
Log.i(folder.name + " updated id=" + message.id + " uid=" + message.uid + " avatar=" + avatar);
}
} }
if (update || process) if (update || process)