From 99ddfc1aa46ae0f677dd2a0eee5d414edd65e223 Mon Sep 17 00:00:00 2001 From: Martin Date: Sun, 10 Apr 2022 13:46:12 +0800 Subject: [PATCH] Return all pubsub IQs. (#137) * Return all pubsub IQs. This makes other pubsub requests accessible via client.Recv(). * Fix formatting (gofmt). --- xmpp.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/xmpp.go b/xmpp.go index 7c9c1fb..8876483 100644 --- a/xmpp.go +++ b/xmpp.go @@ -818,6 +818,14 @@ func (c *Client) Recv() (stanza interface{}, err error) { return handleAvatarMetadata(p.Items[0].Body, v }*/ + default: + res, err := xml.Marshal(v.Query) + if err != nil { + return Chat{}, err + } + + return IQ{ID: v.ID, From: v.From, To: v.To, Type: v.Type, + Query: res}, nil } case v.Query.XMLName.Local == "": return IQ{ID: v.ID, From: v.From, To: v.To, Type: v.Type}, nil