aboutsummaryrefslogtreecommitdiff
path: root/xmpp/extensions
diff options
context:
space:
mode:
authorBohdan Horbeshko <bodqhrohro@gmail.com>2023-06-05 11:22:13 +0300
committerBohdan Horbeshko <bodqhrohro@gmail.com>2023-06-05 11:22:13 +0300
commit7215d11d7973b9896c6223938649c75165fa3ae7 (patch)
tree0aa0bf028cc899a283eb55654ee7618eba167681 /xmpp/extensions
parenta5c90340ad2da16a68ddcbfa3d9573f0664067ca (diff)
XEP-0308 message editing
Diffstat (limited to 'xmpp/extensions')
-rw-r--r--xmpp/extensions/extensions.go17
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{})
}