util.pubsub: Add :get_subscription() to return the current subscription for a JID, if any

Sat, 13 Nov 2010 23:10:50 +0000

author
Matthew Wild <mwild1@gmail.com>
date
Sat, 13 Nov 2010 23:10:50 +0000
changeset 3626
444f965baed8
parent 3625
f8d61da5bcc1
child 3627
9e62937c9757

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

mercurial