mirror of
https://github.com/FluuxIO/go-xmpp.git
synced 2024-11-21 01:52:01 -08:00
Apply namespace fixes from #33
This commit is contained in:
parent
f034b74b54
commit
80d8d6d231
@ -80,8 +80,8 @@ func DiscoResult(c MyComponent, attrs xmpp.PacketAttrs, info *xmpp.DiscoInfo) {
|
||||
payload := xmpp.DiscoInfo{
|
||||
Identity: identity,
|
||||
Features: []xmpp.Feature{
|
||||
{Var: "http://jabber.org/protocol/disco#info"},
|
||||
{Var: "http://jabber.org/protocol/disco#item"},
|
||||
{Var: xmpp.NSDiscoInfo},
|
||||
{Var: xmpp.NSDiscoItems},
|
||||
},
|
||||
}
|
||||
iq.AddPayload(&payload)
|
||||
|
4
iq.go
4
iq.go
@ -318,8 +318,8 @@ type DiscoItem struct {
|
||||
}
|
||||
|
||||
func init() {
|
||||
typeRegistry.MapExtension(PKTIQ, xml.Name{"http://jabber.org/protocol/disco#info", "query"}, DiscoInfo{})
|
||||
typeRegistry.MapExtension(PKTIQ, xml.Name{"http://jabber.org/protocol/disco#items", "query"}, DiscoItems{})
|
||||
typeRegistry.MapExtension(PKTIQ, xml.Name{NSDiscoInfo, "query"}, DiscoInfo{})
|
||||
typeRegistry.MapExtension(PKTIQ, xml.Name{NSDiscoItems, "query"}, DiscoItems{})
|
||||
typeRegistry.MapExtension(PKTIQ, xml.Name{"urn:ietf:params:xml:ns:xmpp-bind", "bind"}, BindBind{})
|
||||
typeRegistry.MapExtension(PKTIQ, xml.Name{"urn:xmpp:iot:control", "set"}, ControlSet{})
|
||||
}
|
||||
|
@ -43,8 +43,8 @@ func TestGenerateIq(t *testing.T) {
|
||||
Type: "mqtt",
|
||||
},
|
||||
Features: []xmpp.Feature{
|
||||
{Var: "http://jabber.org/protocol/disco#info"},
|
||||
{Var: "http://jabber.org/protocol/disco#item"},
|
||||
{Var: xmpp.NSDiscoInfo},
|
||||
{Var: xmpp.NSDiscoItems},
|
||||
},
|
||||
}
|
||||
iq.AddPayload(&payload)
|
||||
|
@ -7,6 +7,8 @@ Support for:
|
||||
- XEP-0333 - Chat Markers: https://xmpp.org/extensions/xep-0333.html
|
||||
*/
|
||||
|
||||
const NSMsgChatMarkers = "urn:xmpp:chat-markers:0"
|
||||
|
||||
type Markable struct {
|
||||
MsgExtension
|
||||
XMLName xml.Name `xml:"urn:xmpp:chat-markers:0 markable"`
|
||||
@ -31,8 +33,8 @@ type MarkAcknowledged struct {
|
||||
}
|
||||
|
||||
func init() {
|
||||
typeRegistry.MapExtension(PKTMessage, xml.Name{"urn:xmpp:chat-markers:0", "markable"}, Markable{})
|
||||
typeRegistry.MapExtension(PKTMessage, xml.Name{"urn:xmpp:chat-markers:0", "received"}, MarkReceived{})
|
||||
typeRegistry.MapExtension(PKTMessage, xml.Name{"urn:xmpp:chat-markers:0", "displayed"}, MarkDisplayed{})
|
||||
typeRegistry.MapExtension(PKTMessage, xml.Name{"urn:xmpp:chat-markers:0", "acknowledged"}, MarkAcknowledged{})
|
||||
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{})
|
||||
}
|
||||
|
@ -7,6 +7,8 @@ Support for:
|
||||
- XEP-0184 - Message Delivery Receipts: https://xmpp.org/extensions/xep-0184.html
|
||||
*/
|
||||
|
||||
const NSMsgReceipts = "urn:xmpp:receipts"
|
||||
|
||||
// Used on outgoing message, to tell the recipient that you are requesting a message receipt / ack.
|
||||
type ReceiptRequest struct {
|
||||
MsgExtension
|
||||
@ -20,6 +22,6 @@ type ReceiptReceived struct {
|
||||
}
|
||||
|
||||
func init() {
|
||||
typeRegistry.MapExtension(PKTMessage, xml.Name{"urn:xmpp:receipts", "request"}, ReceiptRequest{})
|
||||
typeRegistry.MapExtension(PKTMessage, xml.Name{"urn:xmpp:receipts", "received"}, ReceiptReceived{})
|
||||
typeRegistry.MapExtension(PKTMessage, xml.Name{NSMsgReceipts, "request"}, ReceiptRequest{})
|
||||
typeRegistry.MapExtension(PKTMessage, xml.Name{NSMsgReceipts, "received"}, ReceiptReceived{})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user