Comparison

util/pubsub.lua @ 8217:5f4e0d67b82a

util.pubsub: Catch overriden id from storage
author Kim Alvefur <zash@zash.se>
date Wed, 26 Apr 2017 12:06:41 +0200
parent 8212:66173e4b355a
child 8220:a1b0fa38fca7
comparison
equal deleted inserted replaced
8216:d80233ca006d 8217:5f4e0d67b82a
271 item.attr.publisher = actor; 271 item.attr.publisher = actor;
272 local ok = node_data:set(id, item); 272 local ok = node_data:set(id, item);
273 if not ok then 273 if not ok then
274 return nil, "internal-server-error"; 274 return nil, "internal-server-error";
275 end 275 end
276 if type(ok) == "string" then id = ok; end
276 self.events.fire_event("item-published", { node = node, actor = actor, id = id, item = item }); 277 self.events.fire_event("item-published", { node = node, actor = actor, id = id, item = item });
277 self.config.broadcaster("items", node, node_obj.subscribers, item, actor); 278 self.config.broadcaster("items", node, node_obj.subscribers, item, actor);
278 return true; 279 return true;
279 end 280 end
280 281