Properly pass errors in xmpp_pubsub.go
This commit is contained in:
@@ -106,28 +106,28 @@ func pubsubUnsubscriptionStanza(node, jid string) string {
|
|||||||
return pubsubStanza(body)
|
return pubsubStanza(body)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) PubsubSubscribeNode(node, jid string) {
|
func (c *Client) PubsubSubscribeNode(node, jid string) (string, error) {
|
||||||
c.RawInformation(c.jid,
|
return c.RawInformation(c.jid,
|
||||||
jid,
|
jid,
|
||||||
"sub1",
|
"sub1",
|
||||||
"set",
|
"set",
|
||||||
pubsubSubscriptionStanza(node, c.jid))
|
pubsubSubscriptionStanza(node, c.jid))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) PubsubUnsubscribeNode(node, jid string) {
|
func (c *Client) PubsubUnsubscribeNode(node, jid string) (string, error) {
|
||||||
c.RawInformation(c.jid,
|
return c.RawInformation(c.jid,
|
||||||
jid,
|
jid,
|
||||||
"unsub1",
|
"unsub1",
|
||||||
"set",
|
"set",
|
||||||
pubsubUnsubscriptionStanza(node, c.jid))
|
pubsubUnsubscriptionStanza(node, c.jid))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) PubsubRequestLastItems(node, jid string) {
|
func (c *Client) PubsubRequestLastItems(node, jid string) (string, error) {
|
||||||
body := fmt.Sprintf("<items node='%s'/>", node)
|
body := fmt.Sprintf("<items node='%s'/>", node)
|
||||||
c.RawInformation(c.jid, jid, "items1", "get", pubsubStanza(body))
|
return c.RawInformation(c.jid, jid, "items1", "get", pubsubStanza(body))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) PubsubRequestItem(node, jid, id string) {
|
func (c *Client) PubsubRequestItem(node, jid, id string) (string, error) {
|
||||||
body := fmt.Sprintf("<items node='%s'><item id='%s'/></items>", node, id)
|
body := fmt.Sprintf("<items node='%s'><item id='%s'/></items>", node, id)
|
||||||
c.RawInformation(c.jid, jid, "items3", "get", pubsubStanza(body))
|
return c.RawInformation(c.jid, jid, "items3", "get", pubsubStanza(body))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user