Software /
code /
prosody
Changeset
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 |
parents | 1746:3c60081ca10a |
children | 1748:f4c50c75af6f |
files | plugins/muc/mod_muc.lua |
diffstat | 1 files changed, 9 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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