# HG changeset patch # User Kim Alvefur # Date 1360516585 -3600 # Node ID 36e9d5a2ae79b6a6630f8518970a01f5cde69330 # Parent 6ecf44918156d6fcd9aec54a976aee6108cab0c9 plugins.pubsub: Implement retract, purge and delete operations diff -r 6ecf44918156 -r 36e9d5a2ae79 plugins/pubsub.lua --- a/plugins/pubsub.lua Sun Feb 10 18:14:31 2013 +0100 +++ b/plugins/pubsub.lua Sun Feb 10 18:16:25 2013 +0100 @@ -231,13 +231,18 @@ end function pubsub_node:retract(id, callback) - error("Not implemented yet."); + self.stream:send_iq(pubsub_iq("set", self.service, nil, "retract", self.node, nil, id) + , callback); end -function pubsub_node:purge(callback) - error("Not implemented yet."); +function pubsub_node:purge(notify, callback) + assert(not notify, "Not implemented yet."); + self.stream:send_iq(pubsub_iq("set", self.service, xmlns_pubsub_owner, "purge", self.node) + , callback); end -function pubsub_node:delete(callback) - error("Not implemented yet."); +function pubsub_node:delete(redirect_uri, callback) + assert(not redirect_uri, "Not implemented yet."); + self.stream:send_iq(pubsub_iq("set", self.service, xmlns_pubsub_owner, "delete", self.node) + , callback); end