Send request by message if client send service-unavailable

This commit is contained in:
chteufleur 2016-07-16 08:51:03 +02:00
parent 514efc75ce
commit 2e3d328fdd
1 changed files with 8 additions and 1 deletions

View File

@ -4,6 +4,7 @@ import (
"git.kingpenguin.tk/chteufleur/go-xmpp.git/src/xmpp"
"log"
"strings"
)
const (
@ -117,7 +118,13 @@ func processConfirm(x interface{}, client *Client) {
if mesOK && mes.Error != nil {
client.ChanReply <- false
} else if iqOK && iq.Error != nil {
client.ChanReply <- false
if iq.Error.Condition().Local == "service-unavailable" {
// send by message if client doesn't implemente it
client.JID = strings.SplitN(client.JID, "/", 2)[0]
go client.QueryClient()
} else {
client.ChanReply <- false
}
} else {
client.ChanReply <- true
}