Comparison

mod_cloud_notify/mod_cloud_notify.lua @ 4429:157fa4e535b0

mod_cloud_notify: Fix nesting of push form (thanks ivucica/Andrzej)
author Matthew Wild <mwild1@gmail.com>
date Fri, 05 Feb 2021 12:36:48 +0000
parent 4412:e5493a10c4d1
child 4464:ea820de69265
comparison
equal deleted inserted replaced
4428:b328ca621ba6 4429:157fa4e535b0
335 form_data["last-message-body"] = stanza:get_child_text("body"); 335 form_data["last-message-body"] = stanza:get_child_text("body");
336 elseif stanza and dummy_body and is_important(stanza) then 336 elseif stanza and dummy_body and is_important(stanza) then
337 form_data["last-message-body"] = tostring(dummy_body); 337 form_data["last-message-body"] = tostring(dummy_body);
338 end 338 end
339 339
340 push_notification_payload:add_child(push_form:form(form_data));
341
340 local push_publish = st.iq({ to = push_info.jid, from = module.host, type = "set", id = stanza_id }) 342 local push_publish = st.iq({ to = push_info.jid, from = module.host, type = "set", id = stanza_id })
341 :tag("pubsub", { xmlns = "http://jabber.org/protocol/pubsub" }) 343 :tag("pubsub", { xmlns = "http://jabber.org/protocol/pubsub" })
342 :tag("publish", { node = push_info.node }) 344 :tag("publish", { node = push_info.node })
343 :tag("item") 345 :tag("item")
344 :add_child(push_notification_payload) 346 :add_child(push_notification_payload)
345 :add_child(push_form:form(form_data))
346 :up() 347 :up()
347 :up(); 348 :up();
348 349
349 if push_info.options then 350 if push_info.options then
350 push_publish:tag("publish-options"):add_child(st.deserialize(push_info.options)); 351 push_publish:tag("publish-options"):add_child(st.deserialize(push_info.options));