Diff

plugins/pubsub.lua @ 333:36e9d5a2ae79

plugins.pubsub: Implement retract, purge and delete operations
author Kim Alvefur <zash@zash.se>
date Sun, 10 Feb 2013 18:16:25 +0100
parent 332:6ecf44918156
child 337:8dce8240a77c
line wrap: on
line diff
--- 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