From d7aee6b6366c33d13e691a2176f23ad6ab801a6b Mon Sep 17 00:00:00 2001 From: Martin Dosch Date: Fri, 5 Apr 2024 11:57:09 +0200 Subject: [PATCH] Harmonize newlines. --- xmpp.go | 2 +- xmpp_muc.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/xmpp.go b/xmpp.go index b0a8e6d..0487e73 100644 --- a/xmpp.go +++ b/xmpp.go @@ -1296,7 +1296,7 @@ func (c *Client) SendPresence(presence Presence) (n int, err error) { buf = buf + fmt.Sprintf("%s", xmlEscape(presence.Status)) } - stanza := fmt.Sprintf(buf + "") + stanza := fmt.Sprintf(buf + "\n") if c.LimitMaxBytes != 0 && len(stanza) > c.LimitMaxBytes { return 0, fmt.Errorf("stanza size (%v bytes) exceeds server limit (%v bytes)", len(stanza), c.LimitMaxBytes) diff --git a/xmpp_muc.go b/xmpp_muc.go index 25b247e..a80c3e3 100644 --- a/xmpp_muc.go +++ b/xmpp_muc.go @@ -33,10 +33,10 @@ func (c *Client) JoinMUCNoHistory(jid, nick string) (n int, err error) { if nick == "" { nick = c.jid } - return fmt.Fprintf(c.stanzaWriter, "\n"+ + return fmt.Fprintf(c.stanzaWriter, ""+ ""+ - "\n"+ - "", + ""+ + "\n", xmlEscape(jid), xmlEscape(nick), nsMUC) } @@ -53,7 +53,7 @@ func (c *Client) JoinMUC(jid, nick string, history_type, history int, history_da xmlEscape(jid), xmlEscape(nick), nsMUC) case CharHistory: return fmt.Fprintf(c.stanzaWriter, ""+ - "\n"+ + ""+ ""+ "\n", xmlEscape(jid), xmlEscape(nick), nsMUC, history)