summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2023-07-06 21:42:43 +0200
committerxengineering <me@xengineering.eu>2023-07-06 21:42:43 +0200
commita3e01c9a867791b466fe2a3e1d0efd77c840729b (patch)
treea6de98a40ea91cd67e7c87d43668902162e162f2
parent7960453fb4c56d2fdf9cae08df457027bd62ae6d (diff)
downloadlimox-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.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/xmpp/iq.go b/xmpp/iq.go
index 3abcc4a..d3d77b1 100644
--- a/xmpp/iq.go
+++ b/xmpp/iq.go
@@ -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 {