Return all pubsub IQs. (#137)

* Return all pubsub IQs.

This makes other pubsub requests accessible via
client.Recv().

* Fix formatting (gofmt).
This commit is contained in:
Martin 2022-04-10 13:46:12 +08:00 committed by GitHub
parent e773596ea0
commit 99ddfc1aa4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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