somehow sunglocto returned
This commit is contained in:
+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