fix wrong avatar shown when true jid doesn't match in muc

This commit is contained in:
Daniel Gultsch 2018-01-09 10:13:34 +01:00
parent cb80e64d2c
commit 7ab8ed625d
2 changed files with 8 additions and 2 deletions

View file

@ -511,7 +511,7 @@ public class MucOptions {
return null;
}
private User findUserByRealJid(Jid jid) {
public User findUserByRealJid(Jid jid) {
if (jid == null) {
return null;
}

View file

@ -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);
}