2019-06-18 14:28:30 +00:00
|
|
|
package xmpp
|
2019-06-04 16:27:32 +00:00
|
|
|
|
|
|
|
import "encoding/xml"
|
|
|
|
|
|
|
|
/*
|
|
|
|
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() {
|
2019-06-05 08:23:18 +00:00
|
|
|
TypeRegistry.MapExtension(PKTMessage, xml.Name{NSMsgChatMarkers, "markable"}, Markable{})
|
|
|
|
TypeRegistry.MapExtension(PKTMessage, xml.Name{NSMsgChatMarkers, "received"}, MarkReceived{})
|
|
|
|
TypeRegistry.MapExtension(PKTMessage, xml.Name{NSMsgChatMarkers, "displayed"}, MarkDisplayed{})
|
|
|
|
TypeRegistry.MapExtension(PKTMessage, xml.Name{NSMsgChatMarkers, "acknowledged"}, MarkAcknowledged{})
|
2019-06-04 16:27:32 +00:00
|
|
|
}
|