From 52b34a698162ec7d2e249b1a75b42c6a4d465146 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Fri, 10 Feb 2017 21:09:24 +0100 Subject: clear avatar cache when system name changes --- .../de/pixart/messenger/services/XmppConnectionService.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/main/java/de/pixart/messenger/services') diff --git a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java index a81adfe23..8722bc3b7 100644 --- a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java +++ b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java @@ -1590,16 +1590,18 @@ public class XmppConnectionService extends Service { + "#" + phoneContact.getString("lookup"); contact.setSystemAccount(systemAccount); - if (contact.setPhotoUri(phoneContact.getString("photouri"))) { + boolean needsCacheClean = contact.setPhotoUri(phoneContact.getString("photouri")); + needsCacheClean |= contact.setSystemName(phoneContact.getString("displayname")); + if (needsCacheClean) { getAvatarService().clear(contact); } - contact.setSystemName(phoneContact.getString("displayname")); withSystemAccounts.remove(contact); } for (Contact contact : withSystemAccounts) { contact.setSystemAccount(null); - contact.setSystemName(null); - if (contact.setPhotoUri(null)) { + boolean needsCacheClean = contact.setPhotoUri(null); + needsCacheClean |= contact.setSystemName(null); + if (needsCacheClean) { getAvatarService().clear(contact); } } -- cgit v1.2.3