forked from sunglocto/lambda
28 lines
775 B
Go
28 lines
775 B
Go
package main
|
|
|
|
// Implementation of XEP-0045: Multi User Chat 7.2.2
|
|
// https://xmpp.org/extensions/xep-0045.html#enter-pres
|
|
|
|
import (
|
|
"encoding/xml"
|
|
"gosrc.io/xmpp/stanza"
|
|
)
|
|
|
|
type MucUser struct {
|
|
stanza.PresExtension
|
|
XMLName xml.Name `xml:"http://jabber.org/protocol/muc#user x"`
|
|
MucUserItem MucUserItem `xml:"item,omitempty"`
|
|
}
|
|
|
|
type MucUserItem struct {
|
|
XMLName xml.Name
|
|
Affiliation string `xml:"affiliation,attr,omitempty"` // TODO: Use enum
|
|
Role string `xml:"role,attr,omitempty"` // TODO: Use enum
|
|
JID string `xml:"jid,attr,omitempty"`
|
|
Reason string `xml:"reason,omitempty"`
|
|
}
|
|
|
|
func init() {
|
|
stanza.TypeRegistry.MapExtension(stanza.PKTPresence, xml.Name{Space: "http://jabber.org/protocol/muc#user", Local: "x"}, MucUser{})
|
|
}
|