diff --git a/xmpp.go b/xmpp.go index b896eb0..9d257a4 100644 --- a/xmpp.go +++ b/xmpp.go @@ -417,7 +417,7 @@ func (c *Client) init(o *Options) error { return err } - // Generate a uniqe cookie + // Generate a unique cookie cookie := getCookie() // Send IQ message asking to bind to the local user name. @@ -434,6 +434,7 @@ func (c *Client) init(o *Options) error { return errors.New(" result missing ") } c.jid = iq.Bind.Jid // our local id + c.domain = domain if o.Session { //if server support session, open it diff --git a/xmpp_discovery.go b/xmpp_discovery.go new file mode 100644 index 0000000..5e753c1 --- /dev/null +++ b/xmpp_discovery.go @@ -0,0 +1,12 @@ +package xmpp + +import ( + "fmt" +) + +const xmlIqGet = "" + +func (c *Client) Discovery() { + cookie := getCookie() + fmt.Fprintf(c.conn, xmlIqGet, xmlEscape(c.jid), xmlEscape(c.domain), cookie) +}