From 7ab8ed625d6516f27348b04a066e49e9433b41df Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Tue, 9 Jan 2018 10:13:34 +0100 Subject: [PATCH] fix wrong avatar shown when true jid doesn't match in muc --- .../java/eu/siacs/conversations/entities/MucOptions.java | 2 +- .../eu/siacs/conversations/services/AvatarService.java | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/entities/MucOptions.java b/src/main/java/eu/siacs/conversations/entities/MucOptions.java index 4a33883a6..0ea3a2883 100644 --- a/src/main/java/eu/siacs/conversations/entities/MucOptions.java +++ b/src/main/java/eu/siacs/conversations/entities/MucOptions.java @@ -511,7 +511,7 @@ public class MucOptions { return null; } - private User findUserByRealJid(Jid jid) { + public User findUserByRealJid(Jid jid) { if (jid == null) { return null; } diff --git a/src/main/java/eu/siacs/conversations/services/AvatarService.java b/src/main/java/eu/siacs/conversations/services/AvatarService.java index 54f571a10..5296a754d 100644 --- a/src/main/java/eu/siacs/conversations/services/AvatarService.java +++ b/src/main/java/eu/siacs/conversations/services/AvatarService.java @@ -339,7 +339,13 @@ public class AvatarService implements OnAdvancedStreamFeaturesLoaded { if (c != null && (c.getProfilePhoto() != null || c.getAvatar() != null)) { return get(c, size, cachedOnly); } else if (message.getConversation().getMode() == Conversation.MODE_MULTI){ - MucOptions.User user = conversation.getMucOptions().findUserByFullJid(message.getCounterpart()); + final Jid trueCounterpart = message.getTrueCounterpart(); + MucOptions.User user; + if (trueCounterpart != null) { + user = conversation.getMucOptions().findUserByRealJid(trueCounterpart); + } else { + user = conversation.getMucOptions().findUserByFullJid(message.getCounterpart()); + } if (user != null) { return getImpl(user,size,cachedOnly); }