From 67c6af258e7e4f18eac9aa87ff4c6cd2e34bdae3 Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Mon, 7 Sep 2009 20:38:20 +0500 Subject: MUC: Added support for reloading MUC library code. --- plugins/muc/mod_muc.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'plugins/muc') 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 -- cgit v1.2.3