Comparison

plugins/muc/mod_muc.lua @ 1747:28e5f6b535a8

MUC: Added support for reloading MUC library code.
author Waqas Hussain <waqas20@gmail.com>
date Mon, 07 Sep 2009 20:38:20 +0500
parent 1741:2919f3b985fc
child 1748:f4c50c75af6f
comparison
equal deleted inserted replaced
1746:3c60081ca10a 1747:28e5f6b535a8
86 end 86 end
87 module.save = function() 87 module.save = function()
88 return {rooms = rooms}; 88 return {rooms = rooms};
89 end 89 end
90 module.restore = function(data) 90 module.restore = function(data)
91 rooms = data.rooms or {}; 91 rooms = {};
92 for jid, oldroom in pairs(data.rooms) do
93 local room = muc_new_room(jid);
94 room._jid_nick = oldroom._jid_nick;
95 room._occupants = oldroom._occupants;
96 room._data = oldroom._data;
97 room._affiliations = oldroom._affiliations;
98 rooms[jid] = room;
99 end
92 prosody.hosts[module:get_host()].muc = { rooms = rooms }; 100 prosody.hosts[module:get_host()].muc = { rooms = rooms };
93 end 101 end