diff options
author | Matthew Wild <mwild1@gmail.com> | 2012-07-05 17:41:57 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2012-07-05 17:41:57 +0100 |
commit | aa6ac860153d3e5ff9d018beb68b11e187dbdda6 (patch) | |
tree | 205747ed5581214de833dac66288a24b65368e6c | |
parent | 02dc79e546ce19f54b858c102943ee6d80eec584 (diff) | |
parent | 94d42dfe8737ff3b5fe28e56f5b9d7cf0c0a0330 (diff) | |
download | prosody-aa6ac860153d3e5ff9d018beb68b11e187dbdda6.tar.gz prosody-aa6ac860153d3e5ff9d018beb68b11e187dbdda6.zip |
Merge (some of) trunk -> 0.9
-rw-r--r-- | core/certmanager.lua | 2 | ||||
-rw-r--r-- | plugins/muc/mod_muc.lua | 28 |
2 files changed, 19 insertions, 11 deletions
diff --git a/core/certmanager.lua b/core/certmanager.lua index d524a07e..38092654 100644 --- a/core/certmanager.lua +++ b/core/certmanager.lua @@ -78,7 +78,7 @@ function create_context(host, mode, user_ssl_config) 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 --git a/plugins/muc/mod_muc.lua b/plugins/muc/mod_muc.lua index 43b8423d..77ad2647 100644 --- a/plugins/muc/mod_muc.lua +++ b/plugins/muc/mod_muc.lua @@ -65,19 +65,27 @@ local function room_save(room, forced) 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; |