Changeset

3626:444f965baed8

util.pubsub: Add :get_subscription() to return the current subscription for a JID, if any
author Matthew Wild <mwild1@gmail.com>
date Sat, 13 Nov 2010 23:10:50 +0000
parents 3625:f8d61da5bcc1
children 3627:9e62937c9757
files util/pubsub.lua
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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