29 lines
781 B
Go
29 lines
781 B
Go
package main
|
|
|
|
import (
|
|
"encoding/xml"
|
|
"gosrc.io/xmpp/stanza"
|
|
)
|
|
|
|
// Implementation of XEP-0513: Explicit Mentions
|
|
// https://xmpp.org/extensions/xep-0513.html
|
|
|
|
type NoPing struct{}
|
|
type Active struct{}
|
|
|
|
type Mention struct {
|
|
stanza.MsgExtension
|
|
XMLName xml.Name `xml:"urn:xmpp:mentions:0 mention"`
|
|
URI string `xml:"uri,attr,omitempty"`
|
|
Begin int `xml:"begin,attr,omitempty"`
|
|
End int `xml:"end,attr,omitempty"`
|
|
Mentions string `xml:"mentions,attr"`
|
|
OccupantID string `xml:"occupantid,attr,omitempty"`
|
|
NoPing NoPing `xml:"noping,omitempty"`
|
|
Active Active `xml:"active,omitempty"`
|
|
}
|
|
|
|
func init() {
|
|
stanza.TypeRegistry.MapExtension(stanza.PKTMessage, xml.Name{Space: "urn:xmpp:mentions:0", Local: "mention"}, Mention{})
|
|
}
|