2
0
mirror of https://github.com/FluuxIO/go-xmpp synced 2024-11-17 15:29:37 +00:00
go-xmpp/msg_chat_markers.go

41 lines
1.1 KiB
Go
Raw Normal View History

2019-06-04 16:36:29 +00:00
package xmpp // import "gosrc.io/xmpp"
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"
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 `xml:"id,attr"`
}
type MarkDisplayed struct {
MsgExtension
XMLName xml.Name `xml:"urn:xmpp:chat-markers:0 displayed"`
ID string `xml:"id,attr"`
}
type MarkAcknowledged struct {
MsgExtension
XMLName xml.Name `xml:"urn:xmpp:chat-markers:0 acknowledged"`
ID string `xml:"id,attr"`
}
func init() {
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{})
}