diff options
Diffstat (limited to 'src/main/java/eu/siacs/conversations/services')
-rw-r--r-- | src/main/java/eu/siacs/conversations/services/AvatarService.java | 22 | ||||
-rw-r--r-- | src/main/java/eu/siacs/conversations/services/XmppConnectionService.java | 6 |
2 files changed, 19 insertions, 9 deletions
diff --git a/src/main/java/eu/siacs/conversations/services/AvatarService.java b/src/main/java/eu/siacs/conversations/services/AvatarService.java index 55d941e00..899cbf9ea 100644 --- a/src/main/java/eu/siacs/conversations/services/AvatarService.java +++ b/src/main/java/eu/siacs/conversations/services/AvatarService.java @@ -197,8 +197,7 @@ public class AvatarService { public void clear(MucOptions options) { synchronized (this.sizes) { for (Integer size : sizes) { - this.mXmppConnectionService.getBitmapCache().remove( - key(options, size)); + this.mXmppConnectionService.getBitmapCache().remove(key(options, size)); } } } @@ -253,8 +252,15 @@ public class AvatarService { public void clear(Account account) { synchronized (this.sizes) { for (Integer size : sizes) { - this.mXmppConnectionService.getBitmapCache().remove( - key(account, size)); + this.mXmppConnectionService.getBitmapCache().remove(key(account, size)); + } + } + } + + public void clear(MucOptions.User user) { + synchronized (this.sizes) { + for (Integer size : sizes) { + this.mXmppConnectionService.getBitmapCache().remove(key(user, size)); } } } @@ -351,12 +357,12 @@ public class AvatarService { if (avatar != null) { Uri uri = mXmppConnectionService.getFileBackend().getAvatarUri(avatar); if (uri != null) { - drawTile(canvas, uri, left, top, right, bottom); + if (drawTile(canvas, uri, left, top, right, bottom)) { + return true; + } } - } else { - drawTile(canvas, account.getJid().toBareJid().toString(), left, top, right, bottom); } - return true; + return drawTile(canvas, account.getJid().toBareJid().toString(), left, top, right, bottom); } private boolean drawTile(Canvas canvas, String name, int left, int top, int right, int bottom) { diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java index 776069568..dbc4825c9 100644 --- a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java +++ b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java @@ -2367,7 +2367,11 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa if (conversation != null && conversation.getMode() == Conversation.MODE_MULTI) { MucOptions.User user = conversation.getMucOptions().findUser(avatar.owner.getResourcepart()); if (user != null) { - user.setAvatar(avatar); + if (user.setAvatar(avatar)) { + getAvatarService().clear(user); + updateConversationUi(); + updateMucRosterUi(); + } } } } |