From 9d1e8a34b2397abe3d21c91f05df19f43eada2bd Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Fri, 4 Dec 2015 18:39:09 +0100 Subject: [PATCH] fixed showing avatars for contacts in muc --- .../siacs/conversations/services/AvatarService.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/services/AvatarService.java b/src/main/java/eu/siacs/conversations/services/AvatarService.java index 31d625ccd..8c113ab00 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);