aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2009-06-28 21:32:19 +0500
committerWaqas Hussain <waqas20@gmail.com>2009-06-28 21:32:19 +0500
commite0b4f8cb2133898d410a0f376f2a918b05fe5afb (patch)
treee5b5321a680cf735d182a48a6a0cb0583e1b2e35 /plugins
parentf79a4c31bd44cab20a27399ab2f8b712c7055784 (diff)
parent9a3cf5cc0098f3a3b3f8a29d90bc1dae22837aff (diff)
downloadprosody-e0b4f8cb2133898d410a0f376f2a918b05fe5afb.tar.gz
prosody-e0b4f8cb2133898d410a0f376f2a918b05fe5afb.zip
Merged with trunk
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_console.lua9
-rw-r--r--plugins/mod_message.lua2
2 files changed, 7 insertions, 4 deletions
diff --git a/plugins/mod_console.lua b/plugins/mod_console.lua
index 9be37db4..0f2c6711 100644
--- a/plugins/mod_console.lua
+++ b/plugins/mod_console.lua
@@ -162,7 +162,7 @@ end
def_env.module = {};
-local function get_hosts_set(hosts)
+local function get_hosts_set(hosts, module)
if type(hosts) == "table" then
if hosts[1] then
return set.new(hosts);
@@ -172,8 +172,9 @@ local function get_hosts_set(hosts)
elseif type(hosts) == "string" then
return set.new { hosts };
elseif hosts == nil then
+ local mm = require "modulemanager";
return set.new(array.collect(keys(prosody.hosts)))
- / function (host) return prosody.hosts[host].type == "local"; end;
+ / function (host) return prosody.hosts[host].type == "local" or module and mm.is_loaded(host, module); end;
end
end
@@ -203,7 +204,7 @@ end
function def_env.module:unload(name, hosts)
local mm = require "modulemanager";
- hosts = get_hosts_set(hosts);
+ hosts = get_hosts_set(hosts, name);
-- Unload the module for each host
local ok, err, count = true, nil, 0;
@@ -225,7 +226,7 @@ end
function def_env.module:reload(name, hosts)
local mm = require "modulemanager";
- hosts = get_hosts_set(hosts);
+ hosts = get_hosts_set(hosts, name);
-- Reload the module for each host
local ok, err, count = true, nil, 0;
diff --git a/plugins/mod_message.lua b/plugins/mod_message.lua
index 72ccfdd0..b56aef0a 100644
--- a/plugins/mod_message.lua
+++ b/plugins/mod_message.lua
@@ -67,3 +67,5 @@ module:hook("message/bare", function(data)
return process_to_bare(stanza.attr.to or (origin.username..'@'..origin.host), origin, stanza);
end);
+
+module:add_feature("msgoffline");