From cbea85c4dd208ddca8d8a77d920ffdb714775df7 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Tue, 28 Aug 2018 15:04:55 +0200 Subject: [PATCH] special treatment for presence errors known to be mucs --- .../java/eu/siacs/conversations/parser/PresenceParser.java | 2 ++ .../siacs/conversations/services/XmppConnectionService.java | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/src/main/java/eu/siacs/conversations/parser/PresenceParser.java b/src/main/java/eu/siacs/conversations/parser/PresenceParser.java index 062f87b7f..bd09e5d73 100644 --- a/src/main/java/eu/siacs/conversations/parser/PresenceParser.java +++ b/src/main/java/eu/siacs/conversations/parser/PresenceParser.java @@ -353,6 +353,8 @@ public class PresenceParser extends AbstractParser implements this.parseConferencePresence(packet, account); } else if (packet.hasChild("x", "http://jabber.org/protocol/muc")) { this.parseConferencePresence(packet, account); + } else if ("error".equals(packet.getAttribute("type")) && mXmppConnectionService.isMuc(account, packet.getFrom())) { + this.parseConferencePresence(packet, account); } else { this.parseContactPresence(packet, account); } diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java index e4003b87b..7c6a95f15 100644 --- a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java +++ b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java @@ -547,6 +547,11 @@ public class XmppConnectionService extends Service { return find(getConversations(), account, jid); } + public boolean isMuc(final Account account, final Jid jid) { + final Conversation c = find(account, jid); + return c != null && c.getMode() == Conversational.MODE_MULTI; + } + public void search(List term, OnSearchResultsAvailable onSearchResultsAvailable) { MessageSearchTask.search(this, term, onSearchResultsAvailable); }