27 lines
691 B
Go
27 lines
691 B
Go
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{})
|
|
}
|