diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2015-12-04 18:39:09 +0100 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2015-12-04 18:39:09 +0100 |
commit | 9d1e8a34b2397abe3d21c91f05df19f43eada2bd (patch) | |
tree | fc86c10a235ff77b8ff0648daa8971460eab1c39 /src/main/java/eu | |
parent | 196c8e593fa8f98027048d9e097507c108f1410e (diff) |
fixed showing avatars for contacts in muc
Diffstat (limited to 'src/main/java/eu')
-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 31d625cc..8c113ab0 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); |