Changeset

4428:0317b01b6bcd

Merge with Florob
author Matthew Wild <mwild1@gmail.com>
date Sat, 26 Nov 2011 03:50:51 +0000
parents 4423:ded726418b16 (current diff) 4427:ae71ae5ddcfc (diff)
children 4429:8e02ba75ef06
files
diffstat 4 files changed, 11 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/core/loggingmanager.lua	Sun Nov 06 18:23:16 2011 +0100
+++ b/core/loggingmanager.lua	Sat Nov 26 03:50:51 2011 +0000
@@ -41,7 +41,7 @@
 local apply_sink_rules;
 local log_sink_types = setmetatable({}, { __newindex = function (t, k, v) rawset(t, k, v); apply_sink_rules(k); end; });
 local get_levels;
-local logging_levels = { "debug", "info", "warn", "error", "critical" }
+local logging_levels = { "debug", "info", "warn", "error" }
 
 -- Put a rule into action. Requires that the sink type has already been registered.
 -- This function is called automatically when a new sink type is added [see apply_sink_rules()]
--- a/plugins/muc/muc.lib.lua	Sun Nov 06 18:23:16 2011 +0100
+++ b/plugins/muc/muc.lib.lua	Sat Nov 26 03:50:51 2011 +0000
@@ -358,6 +358,7 @@
 		elseif type == "unavailable" then -- unavailable
 			if current_nick then
 				log("debug", "%s leaving %s", current_nick, room);
+				self._jid_nick[from] = nil;
 				local occupant = self._occupants[current_nick];
 				local new_jid = next(occupant.sessions);
 				if new_jid == from then new_jid = next(occupant.sessions, new_jid); end
@@ -382,7 +383,6 @@
 					self:broadcast_presence(pr, from);
 					self._occupants[current_nick] = nil;
 				end
-				self._jid_nick[from] = nil;
 			end
 		elseif not type then -- available
 			if current_nick then
--- a/util/dependencies.lua	Sun Nov 06 18:23:16 2011 +0100
+++ b/util/dependencies.lua	Sat Nov 26 03:50:51 2011 +0000
@@ -136,6 +136,14 @@
 			log("error", "This version of LuaSec contains a known bug that causes disconnects, see http://prosody.im/doc/depends");
 		end
 	end
+	if lxp then
+		if not pcall(lxp.new, { StartDoctypeDecl = false }) then
+			log("error", "The version of LuaExpat on your system leaves Prosody "
+				.."vulnerable to denial-of-service attacks. You should upgrade to "
+				.."LuaExpat 1.1.1 or higher as soon as possible. See "
+				.."http://prosody.im/doc/depends#luaexpat for more information.");
+		end
+	end
 end
 
 return _M;
--- a/util/xmppstream.lua	Sun Nov 06 18:23:16 2011 +0100
+++ b/util/xmppstream.lua	Sat Nov 26 03:50:51 2011 +0000
@@ -11,26 +11,16 @@
 local st = require "util.stanza";
 local stanza_mt = st.stanza_mt;
 
+local error = error;
 local tostring = tostring;
 local t_insert = table.insert;
 local t_concat = table.concat;
 local t_remove = table.remove;
 local setmetatable = setmetatable;
 
-local default_log = require "util.logger".init("xmppstream");
-
 -- COMPAT: w/LuaExpat 1.1.0
 local lxp_supports_doctype = pcall(lxp.new, { StartDoctypeDecl = false });
 
-if not lxp_supports_doctype then
-	default_log("warn", "The version of LuaExpat on your system leaves Prosody "
-		.."vulnerable to denial-of-service attacks. You should upgrade to "
-		.."LuaExpat 1.1.1 or higher as soon as possible. See "
-		.."http://prosody.im/doc/depends#luaexpat for more information.");
-end
-
-local error = error;
-
 module "xmppstream"
 
 local new_parser = lxp.new;
@@ -50,8 +40,6 @@
 function new_sax_handlers(session, stream_callbacks)
 	local xml_handlers = {};
 	
-	local log = session.log or default_log;
-	
 	local cb_streamopened = stream_callbacks.streamopened;
 	local cb_streamclosed = stream_callbacks.streamclosed;
 	local cb_error = stream_callbacks.error or function(session, e) error("XML stream error: "..tostring(e)); end;
@@ -188,7 +176,6 @@
 	
 	local function set_session(stream, new_session)
 		session = new_session;
-		log = new_session.log or default_log;
 	end
 	
 	return xml_handlers, { reset = reset, set_session = set_session };