Attention and experimental mentions impl
This commit is contained in:
27
xmpp-carbons.go
Normal file
27
xmpp-carbons.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"encoding/xml"
|
||||
"gosrc.io/xmpp/stanza"
|
||||
)
|
||||
|
||||
// Implementation of XEP-0280: Message Carbons
|
||||
// https://xmpp.org/extensions/xep-0280.html
|
||||
|
||||
type ReceivedCarbon struct {
|
||||
stanza.MsgExtension
|
||||
XMLName xml.Name `xml:"urn:xmpp:carbons:2 received"`
|
||||
Forwarded stanza.Forwarded
|
||||
}
|
||||
|
||||
|
||||
type SentCarbon struct {
|
||||
stanza.MsgExtension
|
||||
XMLName xml.Name `xml:"urn:xmpp:carbons:2 sent"`
|
||||
Forwarded stanza.Forwarded
|
||||
}
|
||||
|
||||
func init() {
|
||||
stanza.TypeRegistry.MapExtension(stanza.PKTMessage, xml.Name{Space: "urn:xmpp:carbons:2", Local: "received"}, ReceivedCarbon{})
|
||||
stanza.TypeRegistry.MapExtension(stanza.PKTMessage, xml.Name{Space: "urn:xmpp:carbons:2", Local: "sent"}, SentCarbon{})
|
||||
}
|
||||
Reference in New Issue
Block a user