add method to send IQ messages without <query> element

This commit is contained in:
Harald Müller 2017-11-15 09:47:24 +01:00 committed by Yasuhiro Matsumoto
parent fda8e5cb42
commit 2271ce0aec

View File

@ -22,3 +22,10 @@ func (c *Client) RawInformationQuery(from, to, id, iqType, requestNamespace, bod
_, err := fmt.Fprintf(c.conn, xmlIQ, xmlEscape(from), xmlEscape(to), id, iqType, requestNamespace, body)
return id, err
}
// rawInformation send a IQ request with the the payload body to the server
func (c *Client) RawInformation(from, to, id, iqType, body string) (string, error) {
const xmlIQ = "<iq from='%s' to='%s' id='%s' type='%s'>%s</iq>"
_, err := fmt.Fprintf(c.conn, xmlIQ, xmlEscape(from), xmlEscape(to), id, iqType, body)
return id, err
}