2019-06-26 08:14:52 -07:00
|
|
|
package stanza
|
2019-06-04 09:27:32 -07:00
|
|
|
|
2019-06-26 08:14:52 -07:00
|
|
|
import (
|
|
|
|
"encoding/xml"
|
|
|
|
)
|
2019-06-04 09:27:32 -07:00
|
|
|
|
|
|
|
/*
|
|
|
|
Support for:
|
|
|
|
- XEP-0333 - Chat Markers: https://xmpp.org/extensions/xep-0333.html
|
|
|
|
*/
|
|
|
|
|
2019-06-04 23:51:21 -07:00
|
|
|
const NSMsgChatMarkers = "urn:xmpp:chat-markers:0"
|
|
|
|
|
2019-06-04 09:27:32 -07: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 11:26:27 -07:00
|
|
|
ID string `xml:"id,attr"`
|
2019-06-04 09:27:32 -07:00
|
|
|
}
|
|
|
|
|
2019-06-04 18:58:51 -07:00
|
|
|
type MarkDisplayed struct {
|
|
|
|
MsgExtension
|
|
|
|
XMLName xml.Name `xml:"urn:xmpp:chat-markers:0 displayed"`
|
2019-06-06 11:26:27 -07:00
|
|
|
ID string `xml:"id,attr"`
|
2019-06-04 18:58:51 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
type MarkAcknowledged struct {
|
|
|
|
MsgExtension
|
|
|
|
XMLName xml.Name `xml:"urn:xmpp:chat-markers:0 acknowledged"`
|
2019-06-06 11:26:27 -07:00
|
|
|
ID string `xml:"id,attr"`
|
2019-06-04 18:58:51 -07:00
|
|
|
}
|
|
|
|
|
2019-06-04 09:27:32 -07:00
|
|
|
func init() {
|
2020-01-31 02:48:03 -08: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 09:27:32 -07:00
|
|
|
}
|