aboutsummaryrefslogtreecommitdiffstats
path: root/util/pubsub.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2010-11-13 23:10:50 +0000
committerMatthew Wild <mwild1@gmail.com>2010-11-13 23:10:50 +0000
commitdb4d9e500c0ec9376de8ebbd18e7d79ff9fbb722 (patch)
treeb84cd4639863133007553b4e0354ad0b97d03367 /util/pubsub.lua
parentac170b59fed35b0bc465605345b4ad258c56520f (diff)
downloadprosody-db4d9e500c0ec9376de8ebbd18e7d79ff9fbb722.tar.gz
prosody-db4d9e500c0ec9376de8ebbd18e7d79ff9fbb722.zip
util.pubsub: Add :get_subscription() to return the current subscription for a JID, if any
Diffstat (limited to 'util/pubsub.lua')
-rw-r--r--util/pubsub.lua7
1 files changed, 7 insertions, 0 deletions
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