Software /
code /
prosody
Comparison
plugins/muc/mod_muc.lua @ 3577:2cc135cba25b
MUC: Preserve the global rooms table through reloads.
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Tue, 09 Nov 2010 01:19:17 +0500 |
parent | 3576:8d8ce17b83ca |
child | 3589:1792610e169e |
comparison
equal
deleted
inserted
replaced
3576:8d8ce17b83ca | 3577:2cc135cba25b |
---|---|
176 end | 176 end |
177 module.save = function() | 177 module.save = function() |
178 return {rooms = rooms}; | 178 return {rooms = rooms}; |
179 end | 179 end |
180 module.restore = function(data) | 180 module.restore = function(data) |
181 rooms = {}; | |
182 for jid, oldroom in pairs(data.rooms or {}) do | 181 for jid, oldroom in pairs(data.rooms or {}) do |
183 local room = muc_new_room(jid); | 182 local room = muc_new_room(jid); |
184 room._jid_nick = oldroom._jid_nick; | 183 room._jid_nick = oldroom._jid_nick; |
185 room._occupants = oldroom._occupants; | 184 room._occupants = oldroom._occupants; |
186 room._data = oldroom._data; | 185 room._data = oldroom._data; |