24 lines
658 B
Go
24 lines
658 B
Go
package main
|
|
|
|
import (
|
|
"encoding/xml"
|
|
"gosrc.io/xmpp/stanza"
|
|
)
|
|
|
|
// Experimental implementation of XEP-XXXX: Explicit Mentions
|
|
// https://git.isekai.rocks/snit/protoxeps/tree/explicit-mentions.xml
|
|
|
|
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"`
|
|
Type string `xml:"type,attr"`
|
|
Target string `xml:"target,attr,omitempty"`
|
|
}
|
|
|
|
func init() {
|
|
stanza.TypeRegistry.MapExtension(stanza.PKTMessage, xml.Name{Space: "urn:xmpp:mentions:0", Local: "mention"}, Mention{})
|
|
}
|