diff options
author | Christian Schneppe <christian@pix-art.de> | 2018-01-17 23:55:45 +0100 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2018-01-17 23:55:45 +0100 |
commit | f4ba34a4e6e9d9248ad3ec6834702a890de3ac27 (patch) | |
tree | 9a7f2025fd455d878ede3ab311d806e2ed267b1b /src/main | |
parent | 017e99d40e1c7518952273d0a8adb9abf96d77c8 (diff) |
fix wrong avatar shown when true jid doesn't match in muc
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/de/pixart/messenger/entities/MucOptions.java | 2 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/services/AvatarService.java | 8 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/main/java/de/pixart/messenger/entities/MucOptions.java b/src/main/java/de/pixart/messenger/entities/MucOptions.java index eecdcb2f0..e64f78648 100644 --- a/src/main/java/de/pixart/messenger/entities/MucOptions.java +++ b/src/main/java/de/pixart/messenger/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/de/pixart/messenger/services/AvatarService.java b/src/main/java/de/pixart/messenger/services/AvatarService.java index a0fc5ed53..dac42c63d 100644 --- a/src/main/java/de/pixart/messenger/services/AvatarService.java +++ b/src/main/java/de/pixart/messenger/services/AvatarService.java @@ -343,7 +343,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); } |