aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/muc/mod_muc.lua
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2009-09-07 20:38:20 +0500
committerWaqas Hussain <waqas20@gmail.com>2009-09-07 20:38:20 +0500
commit67c6af258e7e4f18eac9aa87ff4c6cd2e34bdae3 (patch)
treea9706032e51ba90aad17824d1842cd7d41e9b6b8 /plugins/muc/mod_muc.lua
parentb9cc8c267d3170f7796a7410e038578c2834d475 (diff)
downloadprosody-67c6af258e7e4f18eac9aa87ff4c6cd2e34bdae3.tar.gz
prosody-67c6af258e7e4f18eac9aa87ff4c6cd2e34bdae3.zip
MUC: Added support for reloading MUC library code.
Diffstat (limited to 'plugins/muc/mod_muc.lua')
-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