Comparison

util/pubsub.lua @ 9179:82fad995a149

util.pubsub: Pass "retract" as the type of such broadcasts This moves some XEP-0060 awkwardness out of util.pubsub and into mod_pubsub A retraction is broadcast in an <items> container, whereas most other kinds of broadcasts are in a container with a name matching the 'kind' attribute.
author Kim Alvefur <zash@zash.se>
date Thu, 16 Aug 2018 14:32:21 +0200
parent 9172:822e9c5ff4a4
child 9195:b6ffd4f951b9
comparison
equal deleted inserted replaced
9178:f226b7b5486b 9179:82fad995a149
521 if not ok then 521 if not ok then
522 return nil, "internal-server-error"; 522 return nil, "internal-server-error";
523 end 523 end
524 self.events.fire_event("item-retracted", { node = node, actor = actor, id = id }); 524 self.events.fire_event("item-retracted", { node = node, actor = actor, id = id });
525 if retract then 525 if retract then
526 self.config.broadcaster("items", node, node_obj.subscribers, retract, actor, node_obj, self); 526 self.config.broadcaster("retract", node, node_obj.subscribers, retract, actor, node_obj, self);
527 end 527 end
528 return true 528 return true
529 end 529 end
530 530
531 function service:purge(node, actor, notify) 531 function service:purge(node, actor, notify)