mirror of
https://github.com/FluuxIO/go-xmpp.git
synced 2026-05-23 04:23:45 -07:00
Xmpp ping fixed to use the obtained jid.
Though a client function, ping does not use the client jid. Fixed ping to use the obtained jid and configured server domain by default. Client now exposes jid.
This commit is contained in:
@@ -5,6 +5,12 @@ import (
|
||||
)
|
||||
|
||||
func (c *Client) PingC2S(jid, server string) error {
|
||||
if jid == "" {
|
||||
jid = c.jid
|
||||
}
|
||||
if server == "" {
|
||||
server = c.domain
|
||||
}
|
||||
_, err := fmt.Fprintf(c.conn, "<iq from='%s' to='%s' id='c2s1' type='get'>\n"+
|
||||
"<ping xmlns='urn:xmpp:ping'/>\n"+
|
||||
"</iq>",
|
||||
|
||||
Reference in New Issue
Block a user