# HG changeset patch # User Waqas Hussain # Date 1252337900 -18000 # Node ID 28e5f6b535a811516cddbc9ff53a843438b9daf7 # Parent 3c60081ca10a81f08f7a5fa525629e836477c1ad MUC: Added support for reloading MUC library code. diff -r 3c60081ca10a -r 28e5f6b535a8 plugins/muc/mod_muc.lua --- a/plugins/muc/mod_muc.lua Mon Sep 07 20:36:29 2009 +0500 +++ b/plugins/muc/mod_muc.lua Mon Sep 07 20:38:20 2009 +0500 @@ -88,6 +88,14 @@ 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