2019-06-18 07:28:30 -07:00
|
|
|
package xmpp
|
2019-06-04 09:27:32 -07:00
|
|
|
|
|
|
|
import "encoding/xml"
|
|
|
|
|
|
|
|
/*
|
|
|
|
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() {
|
2019-06-05 01:23:18 -07: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 09:27:32 -07:00
|
|
|
}
|