Comparison

plugins/mod_pep.lua @ 12962:1b179d14a1dd

mod_pep: Pass node/service objects to broadcaster when resending last item This gives the broadcaster access to the node configuration, which is now important for itemreply. It probably also fixes a bug with the notify_* node config options?
author Matthew Wild <mwild1@gmail.com>
date Wed, 22 Mar 2023 16:46:39 +0000 (21 months ago)
parent 12960:31b22cc221b5
child 12977:74b9e05af71e
comparison
equal deleted inserted replaced
12961:1cbfa843f8c3 12962:1b179d14a1dd
311 local function resend_last_item(jid, node, service) 311 local function resend_last_item(jid, node, service)
312 local ok, config = service:get_node_config(node, true); 312 local ok, config = service:get_node_config(node, true);
313 if ok and config.send_last_published_item ~= "on_sub_and_presence" then return end 313 if ok and config.send_last_published_item ~= "on_sub_and_presence" then return end
314 local ok, id, item = service:get_last_item(node, jid); 314 local ok, id, item = service:get_last_item(node, jid);
315 if not (ok and id) then return; end 315 if not (ok and id) then return; end
316 service.config.broadcaster("items", node, { [jid] = true }, item); 316 service.config.broadcaster("items", node, { [jid] = true }, item, true, service.nodes[node], service);
317 end 317 end
318 318
319 local function update_subscriptions(recipient, service_name, nodes) 319 local function update_subscriptions(recipient, service_name, nodes)
320 nodes = nodes or empty_set; 320 nodes = nodes or empty_set;
321 321