# HG changeset patch # User Matthew Wild # Date 1341506517 -3600 # Node ID d46948d3018a0f8f9ee8d90feec545a54a63f44d # Parent 0545a574667b3de4cdd83917ff58fa4aee7e68d3# Parent 15c1b8aa123da075e4b05f14be3dc93c4a91fad5 Merge (some of) trunk -> 0.9 diff -r 0545a574667b -r d46948d3018a core/certmanager.lua --- a/core/certmanager.lua Wed Jul 04 23:44:13 2012 +0100 +++ b/core/certmanager.lua Thu Jul 05 17:41:57 2012 +0100 @@ -78,7 +78,7 @@ else reason = "Reason: "..tostring(reason):lower(); end - log("error", "SSL/TLS: Failed to load %s: %s (for %s)", file, reason, host); + log("error", "SSL/TLS: Failed to load '%s': %s (for %s)", file, reason, host); else log("error", "SSL/TLS: Error initialising for %s: %s", host, err); end diff -r 0545a574667b -r d46948d3018a plugins/muc/mod_muc.lua --- a/plugins/muc/mod_muc.lua Wed Jul 04 23:44:13 2012 +0100 +++ b/plugins/muc/mod_muc.lua Thu Jul 05 17:41:57 2012 +0100 @@ -65,19 +65,27 @@ if forced then datamanager.store(nil, muc_host, "persistent", persistent_rooms); end end +local persistent_errors = false; for jid in pairs(persistent_rooms) do local node = jid_split(jid); - local data = datamanager.load(node, muc_host, "config") or {}; - local room = muc_new_room(jid, { - max_history_length = max_history_messages; - }); - room._data = data._data; - room._data.max_history_length = max_history_messages; -- Overwrite old max_history_length in data with current settings - room._affiliations = data._affiliations; - room.route_stanza = room_route_stanza; - room.save = room_save; - rooms[jid] = room; + local data = datamanager.load(node, muc_host, "config"); + if data then + local room = muc_new_room(jid, { + max_history_length = max_history_messages; + }); + room._data = data._data; + room._data.max_history_length = max_history_messages; -- Overwrite old max_history_length in data with current settings + room._affiliations = data._affiliations; + room.route_stanza = room_route_stanza; + room.save = room_save; + rooms[jid] = room; + else -- missing room data + persistent_rooms[jid] = nil; + module:log("error", "Missing data for room '%s', removing from persistent room list", jid); + persistent_errors = true; + end end +if persistent_errors then datamanager.store(nil, muc_host, "persistent", persistent_rooms); end local host_room = muc_new_room(muc_host, { max_history_length = max_history_messages;