diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2015-12-04 21:36:48 +0100 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2015-12-04 21:36:48 +0100 |
commit | cd9a29718bcf961cdae2bb88ad65066e7347bfb5 (patch) | |
tree | 17631aa2cc0ab2d161a268b3b6833dca2aaa9669 /src/main/java/eu/siacs/conversations/services/AvatarService.java | |
parent | 9d1e8a34b2397abe3d21c91f05df19f43eada2bd (diff) |
properly clear muc user avatar caches
Diffstat (limited to 'src/main/java/eu/siacs/conversations/services/AvatarService.java')
-rw-r--r-- | src/main/java/eu/siacs/conversations/services/AvatarService.java | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/main/java/eu/siacs/conversations/services/AvatarService.java b/src/main/java/eu/siacs/conversations/services/AvatarService.java index 8c113ab00..be320b6b1 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)); } } } @@ -346,12 +352,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) { |