forked from jshiffer/go-xmpp
Merge pull request #42 from seletskiy/master
Nickname can be specified when joining MUC
This commit is contained in:
commit
846b8175da
@ -17,11 +17,14 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// xep-0045 7.2
|
// xep-0045 7.2
|
||||||
func (c *Client) JoinMUC(jid string) {
|
func (c *Client) JoinMUC(jid, nick string) {
|
||||||
fmt.Fprintf(c.conn, "<presence to='%s'>\n"+
|
if nick == "" {
|
||||||
|
nick = c.jid
|
||||||
|
}
|
||||||
|
fmt.Fprintf(c.conn, "<presence to='%s/%s'>\n"+
|
||||||
"<x xmlns='%s' />\n"+
|
"<x xmlns='%s' />\n"+
|
||||||
"</presence>",
|
"</presence>",
|
||||||
xmlEscape(jid), nsMUC)
|
xmlEscape(jid), xmlEscape(nick), nsMUC)
|
||||||
}
|
}
|
||||||
|
|
||||||
// xep-0045 7.14
|
// xep-0045 7.14
|
||||||
|
Loading…
Reference in New Issue
Block a user