Files
lambda/xmpp-mentions.go
T

29 lines
781 B
Go
Raw Normal View History

2026-03-10 16:35:56 +00:00
package main
import (
"encoding/xml"
"gosrc.io/xmpp/stanza"
)
2026-04-06 11:04:53 +01:00
// Implementation of XEP-0513: Explicit Mentions
// https://xmpp.org/extensions/xep-0513.html
type NoPing struct{}
type Active struct{}
2026-03-10 16:35:56 +00:00
type Mention struct {
stanza.MsgExtension
2026-04-06 11:04:53 +01:00
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"`
2026-03-10 16:35:56 +00:00
}
func init() {
stanza.TypeRegistry.MapExtension(stanza.PKTMessage, xml.Name{Space: "urn:xmpp:mentions:0", Local: "mention"}, Mention{})
}