forked from sunglocto/lambda
22 lines
635 B
Go
22 lines
635 B
Go
|
|
package main
|
||
|
|
|
||
|
|
import (
|
||
|
|
"encoding/xml"
|
||
|
|
"gosrc.io/xmpp/stanza"
|
||
|
|
)
|
||
|
|
|
||
|
|
// Implementation of XEP-0421: Occupant identifiers for semi-anonymous MUCs
|
||
|
|
// https://xmpp.org/extensions/xep-0421.html
|
||
|
|
|
||
|
|
type OccupantID struct {
|
||
|
|
stanza.PresExtension
|
||
|
|
stanza.MsgExtension
|
||
|
|
XMLName xml.Name `xml:"urn:xmpp:occupant-id:0 occupant-id"`
|
||
|
|
ID string `xml:"id,attr"`
|
||
|
|
}
|
||
|
|
|
||
|
|
func init() {
|
||
|
|
stanza.TypeRegistry.MapExtension(stanza.PKTMessage, xml.Name{Space: "urn:xmpp:occupant-id:0", Local: "occupant-id"}, OccupantID{})
|
||
|
|
stanza.TypeRegistry.MapExtension(stanza.PKTPresence, xml.Name{Space: "urn:xmpp:occupant-id:0", Local: "occupant-id"}, OccupantID{})
|
||
|
|
}
|