From 67eaed98b67774c96da8fa79f9ad9265953a093b Mon Sep 17 00:00:00 2001 From: Mickael Remond Date: Tue, 4 Jun 2019 18:27:32 +0200 Subject: [PATCH] Add support for chat markers parsing (XEP-0333) --- msg_chat_markers.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 msg_chat_markers.go diff --git a/msg_chat_markers.go b/msg_chat_markers.go new file mode 100644 index 0000000..3a08443 --- /dev/null +++ b/msg_chat_markers.go @@ -0,0 +1,24 @@ +package xmpp + +import "encoding/xml" + +/* +Support for: +- XEP-0333 - Chat Markers: https://xmpp.org/extensions/xep-0333.html +*/ + +type Markable struct { + MsgExtension + XMLName xml.Name `xml:"urn:xmpp:chat-markers:0 markable"` +} + +type MarkReceived struct { + MsgExtension + XMLName xml.Name `xml:"urn:xmpp:chat-markers:0 received"` + ID string +} + +func init() { + typeRegistry.MapExtension(PKTMessage, xml.Name{"urn:xmpp:chat-markers:0", "markable"}, Markable{}) + typeRegistry.MapExtension(PKTMessage, xml.Name{"urn:xmpp:chat-markers:0", "received"}, MarkReceived{}) +}