diff options
author | Christian Schneppe <christian@pix-art.de> | 2019-06-20 20:55:33 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2019-06-20 20:55:33 +0200 |
commit | 53f93ae996a8d7478132b1f655830cf065d91177 (patch) | |
tree | d7cedbd5c1c2398f93d5a715fd7116d8ba0f8891 /src/main/java/de/pixart | |
parent | 0f6623888a091563a200f7e8351268bc4c597f58 (diff) |
ping muc after receiving not-acceptable error
Diffstat (limited to 'src/main/java/de/pixart')
-rw-r--r-- | src/main/java/de/pixart/messenger/parser/MessageParser.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main/java/de/pixart/messenger/parser/MessageParser.java b/src/main/java/de/pixart/messenger/parser/MessageParser.java index 8c0f89323..5bca3e60f 100644 --- a/src/main/java/de/pixart/messenger/parser/MessageParser.java +++ b/src/main/java/de/pixart/messenger/parser/MessageParser.java @@ -29,6 +29,7 @@ import de.pixart.messenger.crypto.axolotl.XmppAxolotlMessage; import de.pixart.messenger.entities.Account; import de.pixart.messenger.entities.Contact; import de.pixart.messenger.entities.Conversation; +import de.pixart.messenger.entities.Conversational; import de.pixart.messenger.entities.Message; import de.pixart.messenger.entities.MucOptions; import de.pixart.messenger.entities.Presence; @@ -356,6 +357,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); + } + } + } if (message != null) { if (message.getEncryption() == Message.ENCRYPTION_OTR) { Conversation conversation = (Conversation) message.getConversation(); |