diff options
author | Matthew Wild <mwild1@gmail.com> | 2010-11-13 23:10:50 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2010-11-13 23:10:50 +0000 |
commit | db4d9e500c0ec9376de8ebbd18e7d79ff9fbb722 (patch) | |
tree | b84cd4639863133007553b4e0354ad0b97d03367 | |
parent | ac170b59fed35b0bc465605345b4ad258c56520f (diff) | |
download | prosody-db4d9e500c0ec9376de8ebbd18e7d79ff9fbb722.tar.gz prosody-db4d9e500c0ec9376de8ebbd18e7d79ff9fbb722.zip |
util.pubsub: Add :get_subscription() to return the current subscription for a JID, if any
-rw-r--r-- | util/pubsub.lua | 7 |
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 |