aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/muc/mod_muc.lua10
1 files changed, 9 insertions, 1 deletions
diff --git a/plugins/muc/mod_muc.lua b/plugins/muc/mod_muc.lua
index 4a8263ce..35a44bd6 100644
--- a/plugins/muc/mod_muc.lua
+++ b/plugins/muc/mod_muc.lua
@@ -88,6 +88,14 @@ module.save = function()
return {rooms = rooms};
end
module.restore = function(data)
- rooms = data.rooms or {};
+ rooms = {};
+ for jid, oldroom in pairs(data.rooms) do
+ local room = muc_new_room(jid);
+ room._jid_nick = oldroom._jid_nick;
+ room._occupants = oldroom._occupants;
+ room._data = oldroom._data;
+ room._affiliations = oldroom._affiliations;
+ rooms[jid] = room;
+ end
prosody.hosts[module:get_host()].muc = { rooms = rooms };
end