mirror of
https://github.com/FluuxIO/go-xmpp.git
synced 2026-05-23 04:23:45 -07:00
Rework printing of sent stanzas when debug is enabled (#148)
* Rework printing of sent stanzas when debug is enabled This got reworked to also work with multiple connections as pointed out by @vcabbage in https://github.com/mattn/go-xmpp/pull/141#issuecomment-1557334066 * Remove StanzaWriter.
This commit is contained in:
@@ -35,13 +35,13 @@ func (c *Client) DiscoverEntityItems(jid string) (string, error) {
|
||||
// RawInformationQuery sends an information query request to the server.
|
||||
func (c *Client) RawInformationQuery(from, to, id, iqType, requestNamespace, body string) (string, error) {
|
||||
const xmlIQ = "<iq from='%s' to='%s' id='%s' type='%s'><query xmlns='%s'>%s</query></iq>"
|
||||
_, err := fmt.Fprintf(StanzaWriter, xmlIQ, xmlEscape(from), xmlEscape(to), id, iqType, requestNamespace, body)
|
||||
_, err := fmt.Fprintf(c.stanzaWriter, xmlIQ, xmlEscape(from), xmlEscape(to), id, iqType, requestNamespace, body)
|
||||
return id, err
|
||||
}
|
||||
|
||||
// rawInformation send a IQ request with 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(StanzaWriter, xmlIQ, xmlEscape(from), xmlEscape(to), id, iqType, body)
|
||||
_, err := fmt.Fprintf(c.stanzaWriter, xmlIQ, xmlEscape(from), xmlEscape(to), id, iqType, body)
|
||||
return id, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user