From db4d9e500c0ec9376de8ebbd18e7d79ff9fbb722 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Sat, 13 Nov 2010 23:10:50 +0000 Subject: util.pubsub: Add :get_subscription() to return the current subscription for a JID, if any --- util/pubsub.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/util/pubsub.lua b/util/pubsub.lua index 34859fdb..22a29c18 100644 --- a/util/pubsub.lua +++ b/util/pubsub.lua @@ -21,6 +21,13 @@ function service:remove_subscription(node, actor, jid) return true; end +function service:get_subscription(node, actor, jid) + local node_obj = self.nodes[node]; + if node_obj then + return node_obj.subscribers[jid]; + end +end + function service:publish(node, actor, id, item) local node_obj = self.nodes[node]; if not node_obj then -- cgit v1.2.3