diff options
-rw-r--r-- | xmpp/iq.go | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -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!") + } +} |