diff options
author | xengineering <me@xengineering.eu> | 2023-07-06 21:42:43 +0200 |
---|---|---|
committer | xengineering <me@xengineering.eu> | 2023-07-06 21:42:43 +0200 |
commit | a3e01c9a867791b466fe2a3e1d0efd77c840729b (patch) | |
tree | a6de98a40ea91cd67e7c87d43668902162e162f2 | |
parent | 7960453fb4c56d2fdf9cae08df457027bd62ae6d (diff) | |
download | limox-a3e01c9a867791b466fe2a3e1d0efd77c840729b.tar limox-a3e01c9a867791b466fe2a3e1d0efd77c840729b.tar.zst limox-a3e01c9a867791b466fe2a3e1d0efd77c840729b.zip |
Implement roster result handling
This completes the roster get / result cycle which is needed for a MVP.
-rw-r--r-- | xmpp/iq.go | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -14,6 +14,13 @@ type iqRx struct { Bind struct{ Jid string `xml:"jid"` } `xml:"urn:ietf:params:xml:ns:xmpp-bind bind"` + Query []RosterItem `xml:"jabber:iq:roster query>item"` +} + +type RosterItem struct { + Jid string `xml:"jid,attr"` + Subscription string `xml:"subscription,attr"` + Name string `xml:"name,attr"` } func (i iqRx) handle(s *session) { @@ -23,6 +30,13 @@ func (i iqRx) handle(s *session) { s.sendRosterGet() return } + + if len(i.Query) > 0 { + log.Println("Got roster:") + for _, v := range i.Query { + log.Printf("- %s\n", v.Jid) + } + } } type bindSet struct { |