From 39939bd65e46a352137193bb01352b0b2e445727 Mon Sep 17 00:00:00 2001 From: Florian Zeitz Date: Wed, 1 Dec 2010 23:38:47 +0100 Subject: mod_pubsub, util.pubsub: Support node creation --- util/pubsub.lua | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'util') diff --git a/util/pubsub.lua b/util/pubsub.lua index da90fdcc..dc3f3432 100644 --- a/util/pubsub.lua +++ b/util/pubsub.lua @@ -28,6 +28,14 @@ function service:get_subscription(node, actor, jid) end end +function service:create(node, actor) + if not self.nodes[node] then + self.nodes[node] = { name = node, subscribers = {}, config = {}, data = {} }; + return true; + end + return false, "conflict"; +end + function service:publish(node, actor, id, item) local node_obj = self.nodes[node]; if not node_obj then -- cgit v1.2.3