aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/eu/siacs/conversations/entities/MucOptions.java6
-rw-r--r--src/main/java/eu/siacs/conversations/services/AvatarService.java3
-rw-r--r--src/main/java/eu/siacs/conversations/services/XmppConnectionService.java11
3 files changed, 19 insertions, 1 deletions
diff --git a/src/main/java/eu/siacs/conversations/entities/MucOptions.java b/src/main/java/eu/siacs/conversations/entities/MucOptions.java
index 6f6cdf91..7441323a 100644
--- a/src/main/java/eu/siacs/conversations/entities/MucOptions.java
+++ b/src/main/java/eu/siacs/conversations/entities/MucOptions.java
@@ -449,7 +449,7 @@ public class MucOptions {
return null;
}
- public User findUserByRealJid(Jid jid) {
+ private User findUserByRealJid(Jid jid) {
if (jid == null) {
return null;
}
@@ -463,6 +463,10 @@ public class MucOptions {
return null;
}
+ public boolean isContactInRoom(Contact contact) {
+ return findUserByRealJid(contact.getJid().toBareJid()) != null;
+ }
+
public boolean isUserInRoom(Jid jid) {
return findUserByFullJid(jid) != null;
}
diff --git a/src/main/java/eu/siacs/conversations/services/AvatarService.java b/src/main/java/eu/siacs/conversations/services/AvatarService.java
index 9e8e6970..d77f4da5 100644
--- a/src/main/java/eu/siacs/conversations/services/AvatarService.java
+++ b/src/main/java/eu/siacs/conversations/services/AvatarService.java
@@ -99,6 +99,9 @@ public class AvatarService implements OnAdvancedStreamFeaturesLoaded {
key(contact, size));
}
}
+ for(Conversation conversation : mXmppConnectionService.findAllConferencesWith(contact)) {
+ clear(conversation);
+ }
}
private String key(Contact contact, int size) {
diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
index 541bf4b9..26dcb461 100644
--- a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
+++ b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
@@ -1352,6 +1352,17 @@ public class XmppConnectionService extends Service {
return this.accounts;
}
+ public List<Conversation> findAllConferencesWith(Contact contact) {
+ ArrayList<Conversation> results = new ArrayList<>();
+ for(Conversation conversation : conversations) {
+ if (conversation.getMode() == Conversation.MODE_MULTI
+ && conversation.getMucOptions().isContactInRoom(contact)) {
+ results.add(conversation);
+ }
+ }
+ return results;
+ }
+
public Conversation find(final Iterable<Conversation> haystack, final Contact contact) {
for (final Conversation conversation : haystack) {
if (conversation.getContact() == contact) {