Comparison

util/pubsub.lua @ 6515:c9a72c64c3e2

mod_pubsub: Add support for including the publisher in item broadcasts
author Philipp Hancke <fippo@goodadvice.pages.de>
date Thu, 20 Nov 2014 09:01:45 +0000
parent 6439:d58ad8bd244b
child 6516:ecd8d6437053
child 6777:5de6b93d0190
comparison
equal deleted inserted replaced
6510:8273236a995f 6515:c9a72c64c3e2
292 remove_item_by_id(node_data, id); 292 remove_item_by_id(node_data, id);
293 node_data[#node_data + 1] = id; 293 node_data[#node_data + 1] = id;
294 node_data[id] = item; 294 node_data[id] = item;
295 trim_items(node_data, node_obj.config["pubsub#max_items"]); 295 trim_items(node_data, node_obj.config["pubsub#max_items"]);
296 self.events.fire_event("item-published", { node = node, actor = actor, id = id, item = item }); 296 self.events.fire_event("item-published", { node = node, actor = actor, id = id, item = item });
297 self.config.broadcaster("items", node, node_obj.subscribers, item); 297 self.config.broadcaster("items", node, node_obj.subscribers, item, actor);
298 return true; 298 return true;
299 end 299 end
300 300
301 function service:retract(node, actor, id, retract) 301 function service:retract(node, actor, id, retract)
302 -- Access checking 302 -- Access checking