comparison mod_cloud_notify/mod_cloud_notify.lua @ 1924:c84cf61ca0f3

mod_cloud_notify: Wrap notification form in <item>
author Kim Alvefur <zash@zash.se>
date Fri, 23 Oct 2015 15:51:41 +0200
parents b030e46ec640
children 980e5f5bd62c
comparison
equal deleted inserted replaced
1923:b030e46ec640 1924:c84cf61ca0f3
88 for _, push_info in pairs(user_push_services) do 88 for _, push_info in pairs(user_push_services) do
89 push_info.count = push_info.count + 1; 89 push_info.count = push_info.count + 1;
90 local push_jid, push_node = push_info.jid, push_info.node; 90 local push_jid, push_node = push_info.jid, push_info.node;
91 local push_publish = st.iq({ to = push_jid, from = node .. "@" .. module.host, type = "set", id = "push" }) 91 local push_publish = st.iq({ to = push_jid, from = node .. "@" .. module.host, type = "set", id = "push" })
92 :tag("pubsub", { xmlns = "http://jabber.org/protocol/pubsub" }) 92 :tag("pubsub", { xmlns = "http://jabber.org/protocol/pubsub" })
93 :tag("publish", { node = push_node }); 93 :tag("publish", { node = push_node })
94 :tag("item");
94 local form_data = { 95 local form_data = {
95 ["message-count"] = tostring(push_info.count); 96 ["message-count"] = tostring(push_info.count);
96 }; 97 };
97 if include_sender then 98 if include_sender then
98 form_data["last-message-sender"] = stanza.attr.from; 99 form_data["last-message-sender"] = stanza.attr.from;