diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2015-12-04 18:39:09 +0100 |
---|---|---|
committer | Christian S <christian@pix-art.de> | 2015-12-04 20:17:45 +0100 |
commit | 9f7ed976c66991773cd8bd990dc2a94deeaf54a0 (patch) | |
tree | f37bc4607491f7197c7de331bf17c29acd4cfcf1 /src/main/java/eu/siacs/conversations/services | |
parent | ced86f8990f4f89c7acbc3817b270ca8b7a61f43 (diff) |
fixed showing avatars for contacts in muc
Diffstat (limited to 'src/main/java/eu/siacs/conversations/services')
-rw-r--r-- | src/main/java/eu/siacs/conversations/services/AvatarService.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/main/java/eu/siacs/conversations/services/AvatarService.java b/src/main/java/eu/siacs/conversations/services/AvatarService.java index fe6c217de..55d941e00 100644 --- a/src/main/java/eu/siacs/conversations/services/AvatarService.java +++ b/src/main/java/eu/siacs/conversations/services/AvatarService.java @@ -59,6 +59,15 @@ public class AvatarService { } public Bitmap get(final MucOptions.User user, final int size, boolean cachedOnly) { + Contact c = user.getContact(); + if (c != null && (c.getProfilePhoto() != null || c.getAvatar() != null)) { + return get(c, size, cachedOnly); + } else { + return getImpl(user, size, cachedOnly); + } + } + + private Bitmap getImpl(final MucOptions.User user, final int size, boolean cachedOnly) { final String KEY = key(user, size); Bitmap avatar = this.mXmppConnectionService.getBitmapCache().get(KEY); if (avatar != null || cachedOnly) { @@ -232,7 +241,7 @@ public class AvatarService { } else if (message.getConversation().getMode() == Conversation.MODE_MULTI){ MucOptions.User user = conversation.getMucOptions().findUser(message.getCounterpart().getResourcepart()); if (user != null) { - return get(user,size,cachedOnly); + return getImpl(user,size,cachedOnly); } } return get(UIHelper.getMessageDisplayName(message), size, cachedOnly); |