diff --git a/xmpp.go b/xmpp.go index b0a7d2e..ed69756 100644 --- a/xmpp.go +++ b/xmpp.go @@ -64,6 +64,10 @@ type Client struct { p *xml.Decoder } +func (c *Client) JID() string { + return c.jid +} + func connect(host, user, passwd string) (net.Conn, error) { addr := host diff --git a/xmpp_ping.go b/xmpp_ping.go index 685985d..26d056e 100644 --- a/xmpp_ping.go +++ b/xmpp_ping.go @@ -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, "\n"+ "\n"+ "",