X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;f=plugins%2Fmod_admin_adhoc.lua;h=392e715e3b8954fd80a22e119811ae9ec56a29a7;hb=fd1def07a888a9bc882efb61d28e23447ead7c38;hp=405980c253e85e62702985ee39b149a7332a9849;hpb=e59d6ea986ec9c67fdda12f1861ed430ec2ea591;p=prosody.git diff --git a/plugins/mod_admin_adhoc.lua b/plugins/mod_admin_adhoc.lua index 405980c2..392e715e 100644 --- a/plugins/mod_admin_adhoc.lua +++ b/plugins/mod_admin_adhoc.lua @@ -26,10 +26,11 @@ local st, jid = require "util.stanza", require "util.jid"; local timer_add_task = require "util.timer".add_task; local dataforms_new = require "util.dataforms".new; local array = require "util.array"; -local modulemanager = require "modulemanager"; +local modulemanager = require "core.modulemanager"; local core_post_stanza = prosody.core_post_stanza; local adhoc_simple = require "util.adhoc".new_simple_form; local adhoc_initial = require "util.adhoc".new_initial_data_form; +local set = require"util.set"; module:depends("adhoc"); local adhoc_new = module:require "adhoc".new; @@ -246,7 +247,7 @@ local get_user_roster_handler = adhoc_simple(get_user_roster_layout, function(fi local query = st.stanza("query", { xmlns = "jabber:iq:roster" }); for jid in pairs(roster) do - if jid ~= "pending" and jid then + if jid then query:tag("item", { jid = jid, subscription = roster[jid].subscription, @@ -299,7 +300,7 @@ local get_user_stats_handler = adhoc_simple(get_user_stats_layout, function(fiel local IPs = ""; local resources = ""; for jid in pairs(roster) do - if jid ~= "pending" and jid then + if jid then rostersize = rostersize + 1; end end @@ -389,7 +390,7 @@ local function session_flags(session, line) flags[#flags+1] = "encrypted"; end if session.compressed then - flags[#flags+1] = "compressed)"; + flags[#flags+1] = "compressed"; end if session.smacks then flags[#flags+1] = "sm"; @@ -421,7 +422,7 @@ local function list_s2s_this_handler(self, data, state) local sess_lines = { r = remotehost, session_flags(session, { "", direction, remotehost or "?" })}; - if remotehost:match(module_host) or localhost:match(module_host) then + if localhost == module_host then s2s_list[#s2s_list+1] = sess_lines; end end @@ -613,6 +614,7 @@ end, function(fields, err) end); local function send_to_online(message, server) + local sessions; if server then sessions = { [server] = hosts[server] }; else