summaryrefslogtreecommitdiff
path: root/xmpp/iq.go
diff options
context:
space:
mode:
Diffstat (limited to 'xmpp/iq.go')
-rw-r--r--xmpp/iq.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/xmpp/iq.go b/xmpp/iq.go
index 3d0e5a2..3abcc4a 100644
--- a/xmpp/iq.go
+++ b/xmpp/iq.go
@@ -20,6 +20,7 @@ func (i iqRx) handle(s *session) {
if i.Bind.Jid != "" {
s.jid = i.Bind.Jid
s.sendPresence()
+ s.sendRosterGet()
return
}
}
@@ -46,3 +47,21 @@ func (s *session) sendBind() {
log.Println("Could not encode ressource binding!")
}
}
+
+type rosterGet struct {
+ XMLName xml.Name `xml:"jabber:client iq"`
+ Type string `xml:"type,attr,omitempty"`
+ Id string `xml:"id,attr,omitempty"`
+ Query string `xml:"jabber:iq:roster query"`
+}
+
+func (s *session) sendRosterGet() {
+ req := rosterGet{}
+ req.Id = fmt.Sprintf("%016x", rand.Uint64())
+ req.Type = "get"
+
+ err := s.tx.Encode(req)
+ if err != nil {
+ log.Println("Could not encode ressource binding!")
+ }
+}