2019-06-26 15:14:52 +00:00
|
|
|
package stanza
|
2019-06-03 10:40:42 +00:00
|
|
|
|
2019-06-26 15:14:52 +00:00
|
|
|
import (
|
|
|
|
"encoding/xml"
|
|
|
|
)
|
2019-06-03 10:40:42 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
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-03 10:40:42 +00:00
|
|
|
|
2019-06-04 15:04:25 +00:00
|
|
|
type ReceiptReceived struct {
|
2019-06-03 10:40:42 +00:00
|
|
|
MsgExtension
|
2019-06-04 15:04:25 +00:00
|
|
|
XMLName xml.Name `xml:"urn:xmpp:receipts received"`
|
2019-06-06 18:26:27 +00:00
|
|
|
ID string `xml:"id,attr"`
|
2019-06-03 10:40:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func init() {
|
2020-01-31 10:48:03 +00:00
|
|
|
TypeRegistry.MapExtension(PKTMessage, xml.Name{Space: NSMsgReceipts, Local: "request"}, ReceiptRequest{})
|
|
|
|
TypeRegistry.MapExtension(PKTMessage, xml.Name{Space: NSMsgReceipts, Local: "received"}, ReceiptReceived{})
|
2019-06-03 10:40:42 +00:00
|
|
|
}
|