forked from jshiffer/go-xmpp
go fmt
This commit is contained in:
parent
4fdbee9ac5
commit
e543ad3fcd
50
xmpp_muc.go
50
xmpp_muc.go
@ -8,9 +8,9 @@
|
|||||||
package xmpp
|
package xmpp
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
"errors"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -47,33 +47,33 @@ func (c *Client) JoinMUC(jid, nick string, history_type, history int, history_da
|
|||||||
}
|
}
|
||||||
switch history_type {
|
switch history_type {
|
||||||
case NoHistory:
|
case NoHistory:
|
||||||
return fmt.Fprintf(c.conn, "<presence to='%s/%s'>\n" +
|
return fmt.Fprintf(c.conn, "<presence to='%s/%s'>\n"+
|
||||||
"<x xmlns='%s' />\n" +
|
"<x xmlns='%s' />\n"+
|
||||||
"</presence>",
|
"</presence>",
|
||||||
xmlEscape(jid), xmlEscape(nick), nsMUC)
|
xmlEscape(jid), xmlEscape(nick), nsMUC)
|
||||||
case CharHistory:
|
case CharHistory:
|
||||||
return fmt.Fprintf(c.conn, "<presence to='%s/%s'>\n" +
|
return fmt.Fprintf(c.conn, "<presence to='%s/%s'>\n"+
|
||||||
"<x xmlns='%s'>\n" +
|
"<x xmlns='%s'>\n"+
|
||||||
"<history maxchars='%d'/></x>\n"+
|
"<history maxchars='%d'/></x>\n"+
|
||||||
"</presence>",
|
"</presence>",
|
||||||
xmlEscape(jid), xmlEscape(nick), nsMUC, history)
|
xmlEscape(jid), xmlEscape(nick), nsMUC, history)
|
||||||
case StanzaHistory:
|
case StanzaHistory:
|
||||||
return fmt.Fprintf(c.conn, "<presence to='%s/%s'>\n" +
|
return fmt.Fprintf(c.conn, "<presence to='%s/%s'>\n"+
|
||||||
"<x xmlns='%s'>\n" +
|
"<x xmlns='%s'>\n"+
|
||||||
"<history maxstanzas='%d'/></x>\n"+
|
"<history maxstanzas='%d'/></x>\n"+
|
||||||
"</presence>",
|
"</presence>",
|
||||||
xmlEscape(jid), xmlEscape(nick), nsMUC, history)
|
xmlEscape(jid), xmlEscape(nick), nsMUC, history)
|
||||||
case SecondsHistory:
|
case SecondsHistory:
|
||||||
return fmt.Fprintf(c.conn, "<presence to='%s/%s'>\n" +
|
return fmt.Fprintf(c.conn, "<presence to='%s/%s'>\n"+
|
||||||
"<x xmlns='%s'>\n" +
|
"<x xmlns='%s'>\n"+
|
||||||
"<history seconds='%d'/></x>\n"+
|
"<history seconds='%d'/></x>\n"+
|
||||||
"</presence>",
|
"</presence>",
|
||||||
xmlEscape(jid), xmlEscape(nick), nsMUC, history)
|
xmlEscape(jid), xmlEscape(nick), nsMUC, history)
|
||||||
case SinceHistory:
|
case SinceHistory:
|
||||||
if history_date != nil {
|
if history_date != nil {
|
||||||
return fmt.Fprintf(c.conn, "<presence to='%s/%s'>\n" +
|
return fmt.Fprintf(c.conn, "<presence to='%s/%s'>\n"+
|
||||||
"<x xmlns='%s'>\n" +
|
"<x xmlns='%s'>\n"+
|
||||||
"<history since='%s'/></x>\n" +
|
"<history since='%s'/></x>\n"+
|
||||||
"</presence>",
|
"</presence>",
|
||||||
xmlEscape(jid), xmlEscape(nick), nsMUC, history_date.Format(time.RFC3339))
|
xmlEscape(jid), xmlEscape(nick), nsMUC, history_date.Format(time.RFC3339))
|
||||||
}
|
}
|
||||||
@ -88,39 +88,39 @@ func (c *Client) JoinProtectedMUC(jid, nick string, password string, history_typ
|
|||||||
}
|
}
|
||||||
switch history_type {
|
switch history_type {
|
||||||
case NoHistory:
|
case NoHistory:
|
||||||
return fmt.Fprintf(c.conn, "<presence to='%s/%s'>\n" +
|
return fmt.Fprintf(c.conn, "<presence to='%s/%s'>\n"+
|
||||||
"<x xmlns='%s'>\n" +
|
"<x xmlns='%s'>\n"+
|
||||||
"<password>%s</password>" +
|
"<password>%s</password>"+
|
||||||
"</x>\n" +
|
"</x>\n"+
|
||||||
"</presence>",
|
"</presence>",
|
||||||
xmlEscape(jid), xmlEscape(nick), nsMUC, xmlEscape(password))
|
xmlEscape(jid), xmlEscape(nick), nsMUC, xmlEscape(password))
|
||||||
case CharHistory:
|
case CharHistory:
|
||||||
return fmt.Fprintf(c.conn, "<presence to='%s/%s'>\n" +
|
return fmt.Fprintf(c.conn, "<presence to='%s/%s'>\n"+
|
||||||
"<x xmlns='%s'>\n" +
|
"<x xmlns='%s'>\n"+
|
||||||
"<password>%s</password>\n"+
|
"<password>%s</password>\n"+
|
||||||
"<history maxchars='%d'/></x>\n"+
|
"<history maxchars='%d'/></x>\n"+
|
||||||
"</presence>",
|
"</presence>",
|
||||||
xmlEscape(jid), xmlEscape(nick), nsMUC, xmlEscape(password), history)
|
xmlEscape(jid), xmlEscape(nick), nsMUC, xmlEscape(password), history)
|
||||||
case StanzaHistory:
|
case StanzaHistory:
|
||||||
return fmt.Fprintf(c.conn, "<presence to='%s/%s'>\n" +
|
return fmt.Fprintf(c.conn, "<presence to='%s/%s'>\n"+
|
||||||
"<x xmlns='%s'>\n" +
|
"<x xmlns='%s'>\n"+
|
||||||
"<password>%s</password>\n"+
|
"<password>%s</password>\n"+
|
||||||
"<history maxstanzas='%d'/></x>\n"+
|
"<history maxstanzas='%d'/></x>\n"+
|
||||||
"</presence>",
|
"</presence>",
|
||||||
xmlEscape(jid), xmlEscape(nick), nsMUC, xmlEscape(password), history)
|
xmlEscape(jid), xmlEscape(nick), nsMUC, xmlEscape(password), history)
|
||||||
case SecondsHistory:
|
case SecondsHistory:
|
||||||
return fmt.Fprintf(c.conn, "<presence to='%s/%s'>\n" +
|
return fmt.Fprintf(c.conn, "<presence to='%s/%s'>\n"+
|
||||||
"<x xmlns='%s'>\n" +
|
"<x xmlns='%s'>\n"+
|
||||||
"<password>%s</password>\n"+
|
"<password>%s</password>\n"+
|
||||||
"<history seconds='%d'/></x>\n"+
|
"<history seconds='%d'/></x>\n"+
|
||||||
"</presence>",
|
"</presence>",
|
||||||
xmlEscape(jid), xmlEscape(nick), nsMUC, xmlEscape(password), history)
|
xmlEscape(jid), xmlEscape(nick), nsMUC, xmlEscape(password), history)
|
||||||
case SinceHistory:
|
case SinceHistory:
|
||||||
if history_date != nil {
|
if history_date != nil {
|
||||||
return fmt.Fprintf(c.conn, "<presence to='%s/%s'>\n" +
|
return fmt.Fprintf(c.conn, "<presence to='%s/%s'>\n"+
|
||||||
"<x xmlns='%s'>\n" +
|
"<x xmlns='%s'>\n"+
|
||||||
"<password>%s</password>\n"+
|
"<password>%s</password>\n"+
|
||||||
"<history since='%s'/></x>\n" +
|
"<history since='%s'/></x>\n"+
|
||||||
"</presence>",
|
"</presence>",
|
||||||
xmlEscape(jid), xmlEscape(nick), nsMUC, xmlEscape(password), history_date.Format(time.RFC3339))
|
xmlEscape(jid), xmlEscape(nick), nsMUC, xmlEscape(password), history_date.Format(time.RFC3339))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user