Comparison

plugins/mod_pep.lua @ 10672:657e61531b33 0.11

mod_pubsub, mod_pep: Ensure correct number of children of <item/> (fixes #1496)
author Kim Alvefur <zash@zash.se>
date Thu, 27 Feb 2020 20:01:54 +0100
parent 10520:225fade2ab4d
child 10673:1a23a58ac84e
child 11376:774811e2c6ab
comparison
equal deleted inserted replaced
10670:5376f882cf82 10672:657e61531b33
49 module:add_item("pep-service", { service = service, jid = user_bare }); 49 module:add_item("pep-service", { service = service, jid = user_bare });
50 end 50 end
51 end 51 end
52 52
53 function is_item_stanza(item) 53 function is_item_stanza(item)
54 return st.is_stanza(item) and item.attr.xmlns == xmlns_pubsub and item.name == "item"; 54 return st.is_stanza(item) and item.attr.xmlns == xmlns_pubsub and item.name == "item" and #item.tags == 1;
55 end 55 end
56 56
57 function check_node_config(node, actor, new_config) -- luacheck: ignore 212/node 212/actor 57 function check_node_config(node, actor, new_config) -- luacheck: ignore 212/node 212/actor
58 if (new_config["max_items"] or 1) > max_max_items then 58 if (new_config["max_items"] or 1) > max_max_items then
59 return false; 59 return false;