Print sent stanzas in debug mode. (#141)

* Print sent stanzas in debug mode.

* Remove unnecessary newline.
This commit is contained in:
Martin
2023-03-02 05:22:44 +01:00
committed by GitHub
parent 05cd75074a
commit 9fc0b1236c
5 changed files with 37 additions and 34 deletions
+3 -3
View File
@@ -11,7 +11,7 @@ func (c *Client) PingC2S(jid, server string) error {
if server == "" {
server = c.domain
}
_, err := fmt.Fprintf(c.conn, "<iq from='%s' to='%s' id='c2s1' type='get'>\n"+
_, err := fmt.Fprintf(StanzaWriter, "<iq from='%s' to='%s' id='c2s1' type='get'>\n"+
"<ping xmlns='urn:xmpp:ping'/>\n"+
"</iq>",
xmlEscape(jid), xmlEscape(server))
@@ -19,7 +19,7 @@ func (c *Client) PingC2S(jid, server string) error {
}
func (c *Client) PingS2S(fromServer, toServer string) error {
_, err := fmt.Fprintf(c.conn, "<iq from='%s' to='%s' id='s2s1' type='get'>\n"+
_, err := fmt.Fprintf(StanzaWriter, "<iq from='%s' to='%s' id='s2s1' type='get'>\n"+
"<ping xmlns='urn:xmpp:ping'/>\n"+
"</iq>",
xmlEscape(fromServer), xmlEscape(toServer))
@@ -27,7 +27,7 @@ func (c *Client) PingS2S(fromServer, toServer string) error {
}
func (c *Client) SendResultPing(id, toServer string) error {
_, err := fmt.Fprintf(c.conn, "<iq type='result' to='%s' id='%s'/>",
_, err := fmt.Fprintf(StanzaWriter, "<iq type='result' to='%s' id='%s'/>",
xmlEscape(toServer), xmlEscape(id))
return err
}