forked from sunglocto/lambda
initial commit
This commit is contained in:
26
xmpp-mucuser.go
Normal file
26
xmpp-mucuser.go
Normal file
@@ -0,0 +1,26 @@
|
||||
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"`
|
||||
}
|
||||
|
||||
func init() {
|
||||
stanza.TypeRegistry.MapExtension(stanza.PKTPresence, xml.Name{Space: "http://jabber.org/protocol/muc#user", Local: "x"}, MucUser{})
|
||||
}
|
||||
Reference in New Issue
Block a user