From a33d734411604fbb654b4850fddd620dcbf98856 Mon Sep 17 00:00:00 2001 From: chteufleur Date: Wed, 13 Jul 2016 20:26:34 +0200 Subject: [PATCH] Add compatibility with client that doesn't implements the XEP-0070 --- xmpp/xmpp.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/xmpp/xmpp.go b/xmpp/xmpp.go index 6e65735..6d53aa9 100644 --- a/xmpp/xmpp.go +++ b/xmpp/xmpp.go @@ -56,6 +56,15 @@ func mainXMPP() { client := WaitMessageAnswers[confirm.Id] delete(WaitMessageAnswers, confirm.Id) processConfirm(v, client) + } else { + // If body is the confirmation id, it will be considerated as accepted. + // In order to be compatible with all clients. + client := WaitMessageAnswers[v.Body] + jidFrom, _ := xmpp.ParseJID(v.From) + if client != nil && client.JID == jidFrom.Bare() { + delete(WaitMessageAnswers, v.Body) + processConfirm(v, client) + } } case *xmpp.Iq: