# HG changeset patch # User Waqas Hussain # Date 1246206739 -18000 # Node ID f02a5a982facc8be8b79cda08172faa6fe15fd91 # Parent cf2eba9b17161c7fa57c31a2b92eb6de60810372# Parent 064cb5328ac58ff522b4eba09fbb0e1296792dcb Merged with trunk diff -r cf2eba9b1716 -r f02a5a982fac core/componentmanager.lua --- a/core/componentmanager.lua Sun Jun 28 21:29:39 2009 +0500 +++ b/core/componentmanager.lua Sun Jun 28 21:32:19 2009 +0500 @@ -75,7 +75,7 @@ log("debug", "%s stanza being handled by component: %s", stanza.name, host); component(origin, stanza, hosts[host]); else - log("error", "Component manager recieved a stanza for a non-existing component: " .. stanza.attr.to); + log("error", "Component manager recieved a stanza for a non-existing component: " .. (stanza.attr.to or stanza)); end end diff -r cf2eba9b1716 -r f02a5a982fac net/httpserver.lua --- a/net/httpserver.lua Sun Jun 28 21:29:39 2009 +0500 +++ b/net/httpserver.lua Sun Jun 28 21:32:19 2009 +0500 @@ -52,7 +52,7 @@ end else -- Response we have is just a string (the body) - log("debug", "Sending response to %s: %s", request.id, response); + log("debug", "Sending response to %s: %s", request.id or "", response or ""); resp = { "HTTP/1.0 200 OK\r\n" }; t_insert(resp, "Connection: close\r\n"); diff -r cf2eba9b1716 -r f02a5a982fac net/xmppclient_listener.lua --- a/net/xmppclient_listener.lua Sun Jun 28 21:29:39 2009 +0500 +++ b/net/xmppclient_listener.lua Sun Jun 28 21:32:19 2009 +0500 @@ -95,7 +95,7 @@ end session.send(""); session.conn.close(); - xmppclient.disconnect(session.conn, "stream error"); + xmppclient.disconnect(session.conn, reason.condition or reason or "session closed"); end end @@ -136,7 +136,7 @@ local session = sessions[conn]; if session then (session.log or log)("info", "Client disconnected: %s", err); - sm_destroy_session(session); + sm_destroy_session(session, err); sessions[conn] = nil; session = nil; collectgarbage("collect"); diff -r cf2eba9b1716 -r f02a5a982fac plugins/mod_console.lua --- a/plugins/mod_console.lua Sun Jun 28 21:29:39 2009 +0500 +++ b/plugins/mod_console.lua Sun Jun 28 21:32:19 2009 +0500 @@ -162,7 +162,7 @@ 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 @@ 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 @@ 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 @@ 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 -r cf2eba9b1716 -r f02a5a982fac plugins/mod_message.lua --- a/plugins/mod_message.lua Sun Jun 28 21:29:39 2009 +0500 +++ b/plugins/mod_message.lua Sun Jun 28 21:32:19 2009 +0500 @@ -67,3 +67,5 @@ return process_to_bare(stanza.attr.to or (origin.username..'@'..origin.host), origin, stanza); end); + +module:add_feature("msgoffline");