go-xmpp/msg_receipts.go

28 lines
744 B
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-0184 - Message Delivery Receipts: https://xmpp.org/extensions/xep-0184.html
*/
2019-06-05 06:51:21 +00:00
const NSMsgReceipts = "urn:xmpp:receipts"
2019-06-04 15:04:25 +00:00
// Used on outgoing message, to tell the recipient that you are requesting a message receipt / ack.
type ReceiptRequest struct {
MsgExtension
XMLName xml.Name `xml:"urn:xmpp:receipts request"`
}
2019-06-04 15:04:25 +00:00
type ReceiptReceived struct {
MsgExtension
2019-06-04 15:04:25 +00:00
XMLName xml.Name `xml:"urn:xmpp:receipts received"`
ID string `xml:"id,attr"`
}
func init() {
TypeRegistry.MapExtension(PKTMessage, xml.Name{NSMsgReceipts, "request"}, ReceiptRequest{})
TypeRegistry.MapExtension(PKTMessage, xml.Name{NSMsgReceipts, "received"}, ReceiptReceived{})
}