somehow sunglocto returned
This commit is contained in:
1 parent
69994d9856
commit
fc0ed5ac2c
13 files changed
+407
-68
No files matched your search
+24
-9
@@ -28,17 +28,32 @@ func sendMessage(c xmpp.Sender, sendTo string, msgType stanza.StanzaType, body s
|
||||
}
|
||||
|
||||
// Joins a MUC
|
||||
func joinMuc(c xmpp.Sender, jid string, muc string, nick string) error {
|
||||
func joinMuc(c xmpp.Sender, jid string, muc string, nick string, password string) error {
|
||||
var joinPresence stanza.Presence
|
||||
addr := muc + "/" + nick
|
||||
fmt.Println(addr)
|
||||
joinPresence := stanza.Presence{
|
||||
Attrs: stanza.Attrs{
|
||||
From: jid,
|
||||
To: addr,
|
||||
},
|
||||
Extensions: []stanza.PresExtension{
|
||||
&stanza.MucPresence{},
|
||||
},
|
||||
if password == "" {
|
||||
joinPresence = stanza.Presence{
|
||||
Attrs: stanza.Attrs{
|
||||
From: jid,
|
||||
To: addr,
|
||||
},
|
||||
Extensions: []stanza.PresExtension{
|
||||
&stanza.MucPresence{},
|
||||
},
|
||||
}
|
||||
} else {
|
||||
joinPresence = stanza.Presence{
|
||||
Attrs: stanza.Attrs{
|
||||
From: jid,
|
||||
To: addr,
|
||||
},
|
||||
Extensions: []stanza.PresExtension{
|
||||
&stanza.MucPresence{
|
||||
Password: password,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
err := client.Send(joinPresence)
|
||||
|
||||
Reference in new issue
Block a user