Mercurial > prosody-hg
comparison util/pubsub.lua @ 4364:af40cf682eba
util.pubsub: Use built-in actor for auto-creating nodes on publish and subscribe (so they never fail due to permissions)
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Mon, 29 Aug 2011 15:42:15 -0400 |
| parents | 69e3f1e7111e |
| children | 6704b3cd032e |
comparison
equal
deleted
inserted
replaced
| 4363:35ebd8e5747a | 4364:af40cf682eba |
|---|---|
| 102 local node_obj = self.nodes[node]; | 102 local node_obj = self.nodes[node]; |
| 103 if not node_obj then | 103 if not node_obj then |
| 104 if not self.config.autocreate_on_subscribe then | 104 if not self.config.autocreate_on_subscribe then |
| 105 return false, "item-not-found"; | 105 return false, "item-not-found"; |
| 106 else | 106 else |
| 107 local ok, err = self:create(node, actor); | 107 local ok, err = self:create(node, true); |
| 108 if not ok then | 108 if not ok then |
| 109 return ok, err; | 109 return ok, err; |
| 110 end | 110 end |
| 111 node_obj = self.nodes[node]; | 111 node_obj = self.nodes[node]; |
| 112 end | 112 end |
| 218 local node_obj = self.nodes[node]; | 218 local node_obj = self.nodes[node]; |
| 219 if not node_obj then | 219 if not node_obj then |
| 220 if not self.config.autocreate_on_publish then | 220 if not self.config.autocreate_on_publish then |
| 221 return false, "item-not-found"; | 221 return false, "item-not-found"; |
| 222 end | 222 end |
| 223 local ok, err = self:create(node, actor); | 223 local ok, err = self:create(node, true); |
| 224 if not ok then | 224 if not ok then |
| 225 return ok, err; | 225 return ok, err; |
| 226 end | 226 end |
| 227 node_obj = self.nodes[node]; | 227 node_obj = self.nodes[node]; |
| 228 end | 228 end |
