You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I looked around and found a few issues mentioning MUC that seem to indicate it is implemented, but I can't find any documentation on how to actually use it.
Could you point me in the right direction? Thanks!
The text was updated successfully, but these errors were encountered:
Yeah i had to fiddle a bit too but joining a MUC is simple, once you got the hang of it. Looking into XMPP documentation also helps, see XEP0045.
I did it in the postconnect handler of the streammanger here but you should be able to do it whenever you want, as long as the client is connected
funcpostConnect(s xmpp.Sender) {
client, ok:=s.(*xmpp.Client)
if!ok {
fmt.Println("post connect sender not a client, cannot proceed")
//error handling
}
//I used uuids to make sure the id is uniqueuuid, _:=uuid.NewV4()
id:=uuid.String()
//prepare presence for joining the MUCpresence:=stanza.NewPresence(stanza.Attrs{
To: "<mucroom>@<xmppdomain_supporting_muc>/<muc_nickname>",//fill the fields accordinglyFrom: client.Session.BindJid,
Id: id,
})
//as stated in the XEP0045 documentation, you have to tell that you are able to speak mucpresence.Extensions=append(presence.Extensions, stanza.MucPresence{})
//send the stuff and actually join the MUCerr:=client.Send(presence)
iferr!=nil {
//err handling
}
}
Is joining a MUC implemented in this library?
I looked around and found a few issues mentioning MUC that seem to indicate it is implemented, but I can't find any documentation on how to actually use it.
Could you point me in the right direction? Thanks!
The text was updated successfully, but these errors were encountered: