forked from jshiffer/go-xmpp
Harmonize newlines.
This commit is contained in:
parent
0324b31f56
commit
d7aee6b636
2
xmpp.go
2
xmpp.go
@ -1296,7 +1296,7 @@ func (c *Client) SendPresence(presence Presence) (n int, err error) {
|
||||
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 {
|
||||
return 0, fmt.Errorf("stanza size (%v bytes) exceeds server limit (%v bytes)",
|
||||
len(stanza), c.LimitMaxBytes)
|
||||
|
@ -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, "<presence to='%s/%s'>\n"+
|
||||
return fmt.Fprintf(c.stanzaWriter, "<presence to='%s/%s'>"+
|
||||
"<x xmlns='%s'>"+
|
||||
"<history maxchars='0'/></x>\n"+
|
||||
"</presence>",
|
||||
"<history maxchars='0'/></x>"+
|
||||
"</presence>\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, "<presence to='%s/%s'>"+
|
||||
"<x xmlns='%s'>\n"+
|
||||
"<x xmlns='%s'>"+
|
||||
"<history maxchars='%d'/></x>"+
|
||||
"</presence>\n",
|
||||
xmlEscape(jid), xmlEscape(nick), nsMUC, history)
|
||||
|
Loading…
Reference in New Issue
Block a user