Harmonize newlines.

This commit is contained in:
Martin Dosch 2024-04-05 11:57:09 +02:00
parent 0324b31f56
commit d7aee6b636
2 changed files with 5 additions and 5 deletions

View File

@ -1296,7 +1296,7 @@ func (c *Client) SendPresence(presence Presence) (n int, err error) {
buf = buf + fmt.Sprintf("<status>%s</status>", xmlEscape(presence.Status)) buf = buf + fmt.Sprintf("<status>%s</status>", xmlEscape(presence.Status))
} }
stanza := fmt.Sprintf(buf + "</presence>") stanza := fmt.Sprintf(buf + "</presence>\n")
if c.LimitMaxBytes != 0 && len(stanza) > c.LimitMaxBytes { if c.LimitMaxBytes != 0 && len(stanza) > c.LimitMaxBytes {
return 0, fmt.Errorf("stanza size (%v bytes) exceeds server limit (%v bytes)", return 0, fmt.Errorf("stanza size (%v bytes) exceeds server limit (%v bytes)",
len(stanza), c.LimitMaxBytes) len(stanza), c.LimitMaxBytes)

View File

@ -33,10 +33,10 @@ func (c *Client) JoinMUCNoHistory(jid, nick string) (n int, err error) {
if nick == "" { if nick == "" {
nick = c.jid nick = c.jid
} }
return fmt.Fprintf(c.stanzaWriter, "<presence to='%s/%s'>\n"+ return fmt.Fprintf(c.stanzaWriter, "<presence to='%s/%s'>"+
"<x xmlns='%s'>"+ "<x xmlns='%s'>"+
"<history maxchars='0'/></x>\n"+ "<history maxchars='0'/></x>"+
"</presence>", "</presence>\n",
xmlEscape(jid), xmlEscape(nick), nsMUC) 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) xmlEscape(jid), xmlEscape(nick), nsMUC)
case CharHistory: case CharHistory:
return fmt.Fprintf(c.stanzaWriter, "<presence to='%s/%s'>"+ return fmt.Fprintf(c.stanzaWriter, "<presence to='%s/%s'>"+
"<x xmlns='%s'>\n"+ "<x xmlns='%s'>"+
"<history maxchars='%d'/></x>"+ "<history maxchars='%d'/></x>"+
"</presence>\n", "</presence>\n",
xmlEscape(jid), xmlEscape(nick), nsMUC, history) xmlEscape(jid), xmlEscape(nick), nsMUC, history)