2019-06-26 15:14:52 +00:00
|
|
|
package stanza
|
2019-06-04 16:27:32 +00:00
|
|
|
|
2019-06-26 15:14:52 +00:00
|
|
|
import (
|
|
|
|
"encoding/xml"
|
|
|
|
)
|
2019-06-04 16:27:32 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
Support for:
|
|
|
|
- XEP-0333 - Chat Markers: https://xmpp.org/extensions/xep-0333.html
|
|
|
|
*/
|
|
|
|
|
2019-06-05 06:51:21 +00:00
|
|
|
const NSMsgChatMarkers = "urn:xmpp:chat-markers:0"
|
|
|
|
|
2019-06-04 16:27:32 +00:00
|
|
|
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"`
|
2019-06-06 18:26:27 +00:00
|
|
|
ID string `xml:"id,attr"`
|
2019-06-04 16:27:32 +00:00
|
|
|
}
|
|
|
|
|
2019-06-05 01:58:51 +00:00
|
|
|
type MarkDisplayed struct {
|
|
|
|
MsgExtension
|
|
|
|
XMLName xml.Name `xml:"urn:xmpp:chat-markers:0 displayed"`
|
2019-06-06 18:26:27 +00:00
|
|
|
ID string `xml:"id,attr"`
|
2019-06-05 01:58:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type MarkAcknowledged struct {
|
|
|
|
MsgExtension
|
|
|
|
XMLName xml.Name `xml:"urn:xmpp:chat-markers:0 acknowledged"`
|
2019-06-06 18:26:27 +00:00
|
|
|
ID string `xml:"id,attr"`
|
2019-06-05 01:58:51 +00:00
|
|
|
}
|
|
|
|
|
2019-06-04 16:27:32 +00:00
|
|
|
func init() {
|
2020-01-31 10:48:03 +00:00
|
|
|
TypeRegistry.MapExtension(PKTMessage, xml.Name{Space: NSMsgChatMarkers, Local: "markable"}, Markable{})
|
|
|
|
TypeRegistry.MapExtension(PKTMessage, xml.Name{Space: NSMsgChatMarkers, Local: "received"}, MarkReceived{})
|
|
|
|
TypeRegistry.MapExtension(PKTMessage, xml.Name{Space: NSMsgChatMarkers, Local: "displayed"}, MarkDisplayed{})
|
|
|
|
TypeRegistry.MapExtension(PKTMessage, xml.Name{Space: NSMsgChatMarkers, Local: "acknowledged"}, MarkAcknowledged{})
|
2019-06-04 16:27:32 +00:00
|
|
|
}
|