Added Roster IQs

Added an overly primitive "disconnect" for the client to use in the chat client example
This commit is contained in:
CORNIERE Rémi
2019-12-23 09:04:18 +01:00
parent f0179ad90e
commit 390336b894
9 changed files with 278 additions and 11 deletions
+3 -1
View File
@@ -8,6 +8,7 @@ import (
// Disco Info
const (
// NSDiscoInfo defines the namespace for disco IQ stanzas
NSDiscoInfo = "http://jabber.org/protocol/disco#info"
)
@@ -21,6 +22,7 @@ type DiscoInfo struct {
Features []Feature `xml:"feature"`
}
// Namespace lets DiscoInfo implement the IQPayload interface
func (d *DiscoInfo) Namespace() string {
return d.XMLName.Space
}
@@ -112,7 +114,7 @@ func (d *DiscoItems) Namespace() string {
// DiscoItems builds a default DiscoItems payload
func (iq *IQ) DiscoItems() *DiscoItems {
d := DiscoItems{
XMLName: xml.Name{Space: "http://jabber.org/protocol/disco#items", Local: "query"},
XMLName: xml.Name{Space: NSDiscoItems, Local: "query"},
}
iq.Payload = &d
return &d