35 lines
976 B
Go
35 lines
976 B
Go
package main
|
|||
|
|
|
||
|
|
// Implementation of XEP-0045 admin
|
||
|
|
// https://xmpp.org/extensions/xep-0045.html
|
||
|
|
|
||
|
|
import (
|
||
|
|
"encoding/xml"
|
||
|
|
"gosrc.io/xmpp/stanza"
|
||
|
|
)
|
||
|
|
|
||
|
|
type MucAdminQuery struct {
|
||
|
|
XMLName xml.Name `xml:"http://jabber.org/protocol/muc#admin query"`
|
||
|
|
MucAdminItems []MucAdminItem `xml:"http://jabber.org/protocol/muc#admin item"`
|
||
|
|
ResultSet *stanza.ResultSet `xml:"set,omitempty"`
|
||
|
|
}
|
||
|
|
|
||
|
|
type MucAdminItem struct {
|
||
|
|
Affiliation string `xml:"affiliation,attr,omitempty"`
|
||
|
|
JID string `xml:"jid,attr,omitempty"`
|
||
|
|
Nick string `xml:"nick,attr,omitempty"`
|
||
|
|
Role string `xml:"role,attr,omitempty"`
|
||
|
|
Reason string `xml:"reason,omitempty"`
|
||
|
|
}
|
||
|
|
|
||
|
|
func (v *MucAdminQuery) Namespace() string {
|
||
|
|
return v.XMLName.Space
|
||
|
|
}
|
||
|
|
|
||
|
|
func (v *MucAdminQuery) GetSet() *stanza.ResultSet {
|
||
|
|
return v.ResultSet
|
||
|
|
}
|
||
|
|
|
||
|
|
func init() {
|
||
|
|
stanza.TypeRegistry.MapExtension(stanza.PKTIQ, xml.Name{Space: "http://jabber.org/protocol/muc#admin", Local: "query"}, MucAdminQuery{})
|
||
|
|
}
|