Add compatibility with client that doesn't implements the XEP-0070

This commit is contained in:
chteufleur 2016-07-13 20:26:34 +02:00
parent 247b7a1135
commit a33d734411
1 changed files with 9 additions and 0 deletions

View File

@ -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: