diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/muc/mod_muc.lua | 4 | ||||
-rw-r--r-- | plugins/muc/muc.lib.lua | 7 |
2 files changed, 8 insertions, 3 deletions
diff --git a/plugins/muc/mod_muc.lua b/plugins/muc/mod_muc.lua index c8723c16..4410ba16 100644 --- a/plugins/muc/mod_muc.lua +++ b/plugins/muc/mod_muc.lua @@ -130,9 +130,7 @@ local function restore_room(jid) local node = jid_split(jid); local data = room_configs:get(node); if data then - local room = muclib.new_room(jid); - room._data = data._data; - room._affiliations = data._affiliations; + local room = muclib.restore_room(data); track_room(room); return room; end diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua index a7a96865..b289b8ce 100644 --- a/plugins/muc/muc.lib.lua +++ b/plugins/muc/muc.lib.lua @@ -1252,6 +1252,13 @@ function room_mt:freeze() } end +function _M.restore_room(frozen) + local room_jid = frozen.jid; + local room = _M.new_room(room_jid, frozen._data); + room._affiliations = frozen._affiliations; + return room; +end + _M.room_mt = room_mt; return _M; |