Software /
code /
prosody
Diff
util/pubsub.lua @ 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 |
parent | 3619:291ae816d800 |
child | 3641:3603aeb325de |
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