trunk

changeset 4941:d46948d3018a

Merge (some of) trunk -> 0.9
author Matthew Wild <mwild1@gmail.com>
date Thu, 05 Jul 2012 17:41:57 +0100
parents 0545a574667b 15c1b8aa123d
children 716db7d94481 50f63f07245f
files
diffstat 2 files changed, 19 insertions(+), 11 deletions(-) [+]
line diff
     1.1 --- a/core/certmanager.lua	Wed Jul 04 23:44:13 2012 +0100
     1.2 +++ b/core/certmanager.lua	Thu Jul 05 17:41:57 2012 +0100
     1.3 @@ -78,7 +78,7 @@
     1.4  			else
     1.5  				reason = "Reason: "..tostring(reason):lower();
     1.6  			end
     1.7 -			log("error", "SSL/TLS: Failed to load %s: %s (for %s)", file, reason, host);
     1.8 +			log("error", "SSL/TLS: Failed to load '%s': %s (for %s)", file, reason, host);
     1.9  		else
    1.10  			log("error", "SSL/TLS: Error initialising for %s: %s", host, err);
    1.11  		end
     2.1 --- a/plugins/muc/mod_muc.lua	Wed Jul 04 23:44:13 2012 +0100
     2.2 +++ b/plugins/muc/mod_muc.lua	Thu Jul 05 17:41:57 2012 +0100
     2.3 @@ -65,19 +65,27 @@
     2.4  	if forced then datamanager.store(nil, muc_host, "persistent", persistent_rooms); end
     2.5  end
     2.6  
     2.7 +local persistent_errors = false;
     2.8  for jid in pairs(persistent_rooms) do
     2.9  	local node = jid_split(jid);
    2.10 -	local data = datamanager.load(node, muc_host, "config") or {};
    2.11 -	local room = muc_new_room(jid, {
    2.12 -		max_history_length = max_history_messages;
    2.13 -	});
    2.14 -	room._data = data._data;
    2.15 -	room._data.max_history_length = max_history_messages; -- Overwrite old max_history_length in data with current settings
    2.16 -	room._affiliations = data._affiliations;
    2.17 -	room.route_stanza = room_route_stanza;
    2.18 -	room.save = room_save;
    2.19 -	rooms[jid] = room;
    2.20 +	local data = datamanager.load(node, muc_host, "config");
    2.21 +	if data then
    2.22 +		local room = muc_new_room(jid, {
    2.23 +			max_history_length = max_history_messages;
    2.24 +		});
    2.25 +		room._data = data._data;
    2.26 +		room._data.max_history_length = max_history_messages; -- Overwrite old max_history_length in data with current settings
    2.27 +		room._affiliations = data._affiliations;
    2.28 +		room.route_stanza = room_route_stanza;
    2.29 +		room.save = room_save;
    2.30 +		rooms[jid] = room;
    2.31 +	else -- missing room data
    2.32 +		persistent_rooms[jid] = nil;
    2.33 +		module:log("error", "Missing data for room '%s', removing from persistent room list", jid);
    2.34 +		persistent_errors = true;
    2.35 +	end
    2.36  end
    2.37 +if persistent_errors then datamanager.store(nil, muc_host, "persistent", persistent_rooms); end
    2.38  
    2.39  local host_room = muc_new_room(muc_host, {
    2.40  	max_history_length = max_history_messages;