Software /
code /
verse
Changeset
348:34b878d58948
plugins.pubsub: Implement fetching of items
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 06 Jul 2013 08:40:18 +0200 |
parents | 347:48cc6cad9bd6 |
children | 349:dfcc5a0f5c79 351:4455b07f77ed |
files | plugins/pubsub.lua |
diffstat | 1 files changed, 9 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/pubsub.lua Sat Jul 06 08:38:31 2013 +0200 +++ b/plugins/pubsub.lua Sat Jul 06 08:40:18 2013 +0200 @@ -235,12 +235,18 @@ error("Not implemented yet."); end -function pubsub_node:items(count, callback) - error("Not implemented yet."); +function pubsub_node:items(full, callback) + if full then + self.stream:send_iq(pubsub_iq("get", self.service, nil, "items", self.node) + , callback); + else + self.stream:disco_items(self.service, self.node, callback); + end end function pubsub_node:item(id, callback) - error("Not implemented yet."); + self.stream:send_iq(pubsub_iq("get", self.service, nil, "items", self.node, nil, id) + , callback); end function pubsub_node:retract(id, callback)