15 node_obj.subscribers[jid] = true; |
15 node_obj.subscribers[jid] = true; |
16 return true; |
16 return true; |
17 end |
17 end |
18 |
18 |
19 function service:remove_subscription(node, actor, jid) |
19 function service:remove_subscription(node, actor, jid) |
20 self.nodes[node].subscribers[jid] = nil; |
20 local node_obj = self.nodes[node]; |
|
21 if not node_obj then |
|
22 return false, "item-not-found"; |
|
23 end |
|
24 if not node_obj.subscribers[jid] then |
|
25 return false, "not-subscribed"; |
|
26 end |
|
27 node_obj.subscribers[jid] = nil; |
21 return true; |
28 return true; |
22 end |
29 end |
23 |
30 |
24 function service:get_subscription(node, actor, jid) |
31 function service:get_subscription(node, actor, jid) |
25 local node_obj = self.nodes[node]; |
32 local node_obj = self.nodes[node]; |