comparison mod_pubsub_stats/mod_pubsub_stats.lua @ 3160:330e8c81f6af

mod_pubsub_stats: Include namespace on pubsub items (fixes use with trunk)
author Kim Alvefur <zash@zash.se>
date Mon, 02 Jul 2018 10:14:13 +0200
parents 8a870e0319db
children 44c5d7310c33
comparison
equal deleted inserted replaced
3159:e995cd0f228e 3160:330e8c81f6af
2 2
3 local pubsub = module:depends"pubsub"; 3 local pubsub = module:depends"pubsub";
4 4
5 local actor = module.host .. "/modules/" .. module.name; 5 local actor = module.host .. "/modules/" .. module.name;
6 6
7 local pubsub_xmlns = "http://jabber.org/protocol/pubsub"
8
7 local node = module:get_option_string(module.name .. "_node", "stats"); 9 local node = module:get_option_string(module.name .. "_node", "stats");
8 10
9 local function publish_stats(stats, stats_extra) 11 local function publish_stats(stats, stats_extra)
10 local id = "current"; 12 local id = "current";
11 local xitem = st.stanza("item", { id = id }) 13 local xitem = st.stanza("item", { xmlns = pubsub_xmlns, id = id })
12 :tag("query", { xmlns = "http://jabber.org/protocol/stats" }); 14 :tag("query", { xmlns = "http://jabber.org/protocol/stats" });
13 15
14 for name, value in pairs(stats) do 16 for name, value in pairs(stats) do
15 local stat_extra = stats_extra[name]; 17 local stat_extra = stats_extra[name];
16 local unit = stat_extra and stat_extra.units; 18 local unit = stat_extra and stat_extra.units;