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:
Martin
2023-07-28 16:42:12 +02:00
committed by GitHub
parent bef3e549f7
commit 98ff0d4df7
5 changed files with 47 additions and 47 deletions
+3 -3
View File
@@ -5,12 +5,12 @@ import (
)
func (c *Client) ApproveSubscription(jid string) {
fmt.Fprintf(StanzaWriter, "<presence to='%s' type='subscribed'/>",
fmt.Fprintf(c.stanzaWriter, "<presence to='%s' type='subscribed'/>",
xmlEscape(jid))
}
func (c *Client) RevokeSubscription(jid string) {
fmt.Fprintf(StanzaWriter, "<presence to='%s' type='unsubscribed'/>",
fmt.Fprintf(c.stanzaWriter, "<presence to='%s' type='unsubscribed'/>",
xmlEscape(jid))
}
@@ -20,6 +20,6 @@ func (c *Client) RetrieveSubscription(jid string) {
}
func (c *Client) RequestSubscription(jid string) {
fmt.Fprintf(StanzaWriter, "<presence to='%s' type='subscribe'/>",
fmt.Fprintf(c.stanzaWriter, "<presence to='%s' type='subscribe'/>",
xmlEscape(jid))
}