# HG changeset patch # User daurnimator # Date 1413578146 14400 # Node ID d016437e01bf3cfd31bf2bd8938691a3c1014963 # Parent 413923bbd1a0290b246528bdbe91ca49b1d4c43e plugins/muc/mod_muc: Add 'local_only' flag to mod_muc, so rooms don't get restored on shutdown diff -r 413923bbd1a0 -r d016437e01bf plugins/muc/mod_muc.lua --- a/plugins/muc/mod_muc.lua Wed Oct 15 17:08:19 2014 -0400 +++ b/plugins/muc/mod_muc.lua Fri Oct 17 16:35:46 2014 -0400 @@ -122,12 +122,14 @@ return room end -function each_room() - for room_jid in pairs(persistent_rooms_storage:get(nil) or {}) do - if rooms[room_jid] == nil then -- Don't restore rooms that already exist - local room = restore_room(room_jid); - if room == nil then - module:log("error", "Missing data for room '%s', omitting from iteration", room_jid); +function each_room(local_only) + if not local_only then + for room_jid in pairs(persistent_rooms_storage:get(nil) or {}) do + if rooms[room_jid] == nil then -- Don't restore rooms that already exist + local room = restore_room(room_jid); + if room == nil then + module:log("error", "Missing data for room '%s', omitting from iteration", room_jid); + end end end end @@ -217,7 +219,7 @@ function shutdown_component() local x = st.stanza("x", {xmlns = "http://jabber.org/protocol/muc#user"}) :tag("status", { code = "332"}):up(); - for room in each_room() do + for room in each_room(true) do room:clear(x); end end