diff options
author | Bohdan Horbeshko <bodqhrohro@gmail.com> | 2023-06-05 11:22:13 +0300 |
---|---|---|
committer | Bohdan Horbeshko <bodqhrohro@gmail.com> | 2023-06-05 11:22:13 +0300 |
commit | 7215d11d7973b9896c6223938649c75165fa3ae7 (patch) | |
tree | 0aa0bf028cc899a283eb55654ee7618eba167681 /xmpp/extensions | |
parent | a5c90340ad2da16a68ddcbfa3d9573f0664067ca (diff) |
XEP-0308 message editing
Diffstat (limited to 'xmpp/extensions')
-rw-r--r-- | xmpp/extensions/extensions.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/xmpp/extensions/extensions.go b/xmpp/extensions/extensions.go index 78de47d..2d547af 100644 --- a/xmpp/extensions/extensions.go +++ b/xmpp/extensions/extensions.go @@ -180,6 +180,12 @@ type ClientMessage struct { Extensions []stanza.MsgExtension `xml:",omitempty"` } +// Replace is from XEP-0308 +type Replace struct { + XMLName xml.Name `xml:"urn:xmpp:message-correct:0 replace"` + Id string `xml:"id,attr"` +} + // Namespace is a namespace! func (c PresenceNickExtension) Namespace() string { return c.XMLName.Space @@ -225,6 +231,11 @@ func (c ComponentPrivilege) Namespace() string { return c.XMLName.Space } +// Namespace is a namespace! +func (c Replace) Namespace() string { + return c.XMLName.Space +} + // Name is a packet name func (ClientMessage) Name() string { return "message" @@ -291,4 +302,10 @@ func init() { "urn:xmpp:privilege:1", "privilege", }, ComponentPrivilege{}) + + // message edit + stanza.TypeRegistry.MapExtension(stanza.PKTMessage, xml.Name{ + "urn:xmpp:message-correct:0", + "replace", + }, Replace{}) } |