Add support for chat markers parsing (XEP-0333)

This commit is contained in:
Mickael Remond 2019-06-04 18:27:32 +02:00 committed by Mickaël Rémond
parent 7a4364be95
commit 67eaed98b6

24
msg_chat_markers.go Normal file
View file

@ -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{})
}