Merged with trunk

Sun, 28 Jun 2009 21:32:19 +0500

author
Waqas Hussain <waqas20@gmail.com>
date
Sun, 28 Jun 2009 21:32:19 +0500
changeset 1438
f02a5a982fac
parent 1437
cf2eba9b1716 (current diff)
parent 1436
064cb5328ac5 (diff)
child 1439
f989608964ec

Merged with trunk

--- 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
 
--- 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 "<none>", response or "<none>");
 		
 		resp = { "HTTP/1.0 200 OK\r\n" };
 		t_insert(resp, "Connection: close\r\n");
--- 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("</stream:stream>");
 		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");
--- 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;
--- 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");

mercurial