diff options
author | Waqas Hussain <waqas20@gmail.com> | 2009-01-13 22:38:20 +0500 |
---|---|---|
committer | Waqas Hussain <waqas20@gmail.com> | 2009-01-13 22:38:20 +0500 |
commit | 53fd89fe983d974a391c066ae3b65c9295623d56 (patch) | |
tree | 6e187b6e2c21c2ddae41f0409c33c34ac064ca15 /plugins/mod_muc.lua | |
parent | a138bcd591d3fa2240b41720b426743a6c05ac9d (diff) | |
download | prosody-53fd89fe983d974a391c066ae3b65c9295623d56.tar.gz prosody-53fd89fe983d974a391c066ae3b65c9295623d56.zip |
mod_muc: Added unload, save and restore callbacks to allow reloading code while preserving state
Diffstat (limited to 'plugins/mod_muc.lua')
-rw-r--r-- | plugins/mod_muc.lua | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/plugins/mod_muc.lua b/plugins/mod_muc.lua index c19af879..f1b46eed 100644 --- a/plugins/mod_muc.lua +++ b/plugins/mod_muc.lua @@ -274,7 +274,13 @@ component = register_component(muc_domain, function(origin, stanza) end
end);
-function unload()
+module.unload = function()
deregister_component(muc_domain);
end
-
+module.save = function()
+ return {rooms = rooms.data; jid_nick = jid_nick.data; rooms_info = rooms_info.data; persist_list = persist_list};
+end
+module.restore = function(data)
+ rooms.data, jid_nick.data, rooms_info.data, persist_list =
+ data.rooms or {}, data.jid_nick or {}, data.rooms_info or {}, data.persist_list or {};
+end
|