Sat, 13 Nov 2010 23:10:50 +0000
util.pubsub: Add :get_subscription() to return the current subscription for a JID, if any
util/pubsub.lua | file | annotate | diff | comparison | revisions |
--- a/util/pubsub.lua Sat Nov 13 23:10:13 2010 +0000 +++ b/util/pubsub.lua Sat Nov 13 23:10:50 2010 +0000 @@ -21,6 +21,13 @@ 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