somehow sunglocto returned

This commit is contained in:
2026-04-26 10:40:13 +01:00
parent 69994d9856
commit fc0ed5ac2c
13 changed files with 407 additions and 68 deletions
+24 -9
View File
@@ -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)