Software /
code /
prosody
Comparison
plugins/mod_storage_xep0227.lua @ 12174:a38b7cb5fd6a
mod_storage_xep0227: Support for exporting nodes with no stored configuration
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Mon, 10 Jan 2022 15:48:45 +0000 |
parent | 12173:270047afa6af |
child | 12175:39921b979edb |
comparison
equal
deleted
inserted
replaced
12173:270047afa6af | 12174:a38b7cb5fd6a |
---|---|
352 | 352 |
353 -- Generate new data | 353 -- Generate new data |
354 local owner_el = st.stanza("pubsub", { xmlns = xmlns_pubsub_owner }); | 354 local owner_el = st.stanza("pubsub", { xmlns = xmlns_pubsub_owner }); |
355 | 355 |
356 for node_name, node_data in pairs(data) do | 356 for node_name, node_data in pairs(data) do |
357 if node_data == true then | |
358 node_data = { config = {} }; | |
359 end | |
357 local configure_el = st.stanza("configure", { node = node_name }) | 360 local configure_el = st.stanza("configure", { node = node_name }) |
358 :add_child(lib_pubsub.node_config_form:form(node_data.config, "submit")); | 361 :add_child(lib_pubsub.node_config_form:form(node_data.config, "submit")); |
359 owner_el:add_child(configure_el); | 362 owner_el:add_child(configure_el); |
360 if node_data.affiliations and next(node_data.affiliations) ~= nil then | 363 if node_data.affiliations and next(node_data.affiliations) ~= nil then |
361 local affiliations_el = st.stanza("affiliations", { node = node_name }); | 364 local affiliations_el = st.stanza("affiliations", { node = node_name }); |