Send request by message if client send service-unavailable
This commit is contained in:
parent
514efc75ce
commit
2e3d328fdd
|
|
@ -4,6 +4,7 @@ import (
|
||||||
"git.kingpenguin.tk/chteufleur/go-xmpp.git/src/xmpp"
|
"git.kingpenguin.tk/chteufleur/go-xmpp.git/src/xmpp"
|
||||||
|
|
||||||
"log"
|
"log"
|
||||||
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
@ -117,7 +118,13 @@ func processConfirm(x interface{}, client *Client) {
|
||||||
if mesOK && mes.Error != nil {
|
if mesOK && mes.Error != nil {
|
||||||
client.ChanReply <- false
|
client.ChanReply <- false
|
||||||
} else if iqOK && iq.Error != nil {
|
} 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 {
|
} else {
|
||||||
client.ChanReply <- true
|
client.ChanReply <- true
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue