Comparison

util/pubsub.lua @ 3937:843ee23cc91a

util.pubsub: Small code tidying for :get_subscription()
author Matthew Wild <mwild1@gmail.com>
date Wed, 22 Dec 2010 03:46:07 +0000
parent 3936:61f12f8a8539
child 3938:a3ecaf46bd82
comparison
equal deleted inserted replaced
3936:61f12f8a8539 3937:843ee23cc91a
152 if not self:may(node, actor, cap) then 152 if not self:may(node, actor, cap) then
153 return false, "forbidden"; 153 return false, "forbidden";
154 end 154 end
155 -- 155 --
156 local node_obj = self.nodes[node]; 156 local node_obj = self.nodes[node];
157 if node_obj then 157 if not node_obj then
158 return true, node_obj.subscribers[jid]; 158 return false, "item-not-found";
159 end 159 end
160 return true, node_obj.subscribers[jid];
160 end 161 end
161 162
162 function service:create(node, actor) 163 function service:create(node, actor)
163 -- Access checking 164 -- Access checking
164 if not self:may(node, actor, "create") then 165 if not self:may(node, actor, "create") then