|
|
|
@ -154,12 +154,19 @@ type CarbonSent struct {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ComponentPrivilege is from XEP-0356
|
|
|
|
|
type ComponentPrivilege struct {
|
|
|
|
|
type ComponentPrivilege1 struct {
|
|
|
|
|
XMLName xml.Name `xml:"urn:xmpp:privilege:1 privilege"`
|
|
|
|
|
Perms []ComponentPerm `xml:"perm"`
|
|
|
|
|
Forwarded stanza.Forwarded `xml:"urn:xmpp:forward:0 forwarded"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ComponentPrivilege is from XEP-0356
|
|
|
|
|
type ComponentPrivilege2 struct {
|
|
|
|
|
XMLName xml.Name `xml:"urn:xmpp:privilege:2 privilege"`
|
|
|
|
|
Perms []ComponentPerm `xml:"perm"`
|
|
|
|
|
Forwarded stanza.Forwarded `xml:"urn:xmpp:forward:0 forwarded"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ComponentPerm is from XEP-0356
|
|
|
|
|
type ComponentPerm struct {
|
|
|
|
|
XMLName xml.Name `xml:"perm"`
|
|
|
|
@ -227,7 +234,12 @@ func (c CarbonSent) Namespace() string {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Namespace is a namespace!
|
|
|
|
|
func (c ComponentPrivilege) Namespace() string {
|
|
|
|
|
func (c ComponentPrivilege1) Namespace() string {
|
|
|
|
|
return c.XMLName.Space
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Namespace is a namespace!
|
|
|
|
|
func (c ComponentPrivilege2) Namespace() string {
|
|
|
|
|
return c.XMLName.Space
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -297,11 +309,17 @@ func init() {
|
|
|
|
|
"sent",
|
|
|
|
|
}, CarbonSent{})
|
|
|
|
|
|
|
|
|
|
// component privilege
|
|
|
|
|
// component privilege v1
|
|
|
|
|
stanza.TypeRegistry.MapExtension(stanza.PKTMessage, xml.Name{
|
|
|
|
|
"urn:xmpp:privilege:1",
|
|
|
|
|
"privilege",
|
|
|
|
|
}, ComponentPrivilege{})
|
|
|
|
|
}, ComponentPrivilege1{})
|
|
|
|
|
|
|
|
|
|
// component privilege v2
|
|
|
|
|
stanza.TypeRegistry.MapExtension(stanza.PKTMessage, xml.Name{
|
|
|
|
|
"urn:xmpp:privilege:2",
|
|
|
|
|
"privilege",
|
|
|
|
|
}, ComponentPrivilege2{})
|
|
|
|
|
|
|
|
|
|
// message edit
|
|
|
|
|
stanza.TypeRegistry.MapExtension(stanza.PKTMessage, xml.Name{
|
|
|
|
|