From b6d059ed8985a6595d3bf9d00f1314c662c06c3f Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Tue, 18 Jun 2019 18:40:16 +0200 Subject: [PATCH] ping muc after receiving not-acceptable error --- .../eu/siacs/conversations/parser/MessageParser.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/java/eu/siacs/conversations/parser/MessageParser.java b/src/main/java/eu/siacs/conversations/parser/MessageParser.java index 72aaf1fa0..85483c1b7 100644 --- a/src/main/java/eu/siacs/conversations/parser/MessageParser.java +++ b/src/main/java/eu/siacs/conversations/parser/MessageParser.java @@ -22,6 +22,7 @@ import eu.siacs.conversations.crypto.axolotl.XmppAxolotlMessage; import eu.siacs.conversations.entities.Account; import eu.siacs.conversations.entities.Contact; import eu.siacs.conversations.entities.Conversation; +import eu.siacs.conversations.entities.Conversational; import eu.siacs.conversations.entities.Message; import eu.siacs.conversations.entities.MucOptions; import eu.siacs.conversations.entities.ReadByMarker; @@ -264,6 +265,17 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece packet.getId(), Message.STATUS_SEND_FAILED, extractErrorMessage(packet)); + final Element error = packet.findChild("error"); + final boolean notAcceptable = error != null && error.hasChild("not-acceptable"); + if (notAcceptable) { + Conversation conversation = mXmppConnectionService.find(account,from); + if (conversation != null && conversation.getMode() == Conversational.MODE_MULTI) { + if (conversation.getMucOptions().online()) { + Log.d(Config.LOGTAG,account.getJid().asBareJid()+": received not-acceptable error for seemingly online muc at "+from); + mXmppConnectionService.mucSelfPingAndRejoin(conversation); + } + } + } } return true; }