Changeset

711:7653519ec4f2

mod_muc: Added unload, save and restore callbacks to allow reloading code while preserving state
author Waqas Hussain <waqas20@gmail.com>
date Tue, 13 Jan 2009 22:38:20 +0500
parents 710:56f6c115bc69
children 712:56410c0cd846
files plugins/mod_muc.lua
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_muc.lua	Tue Jan 13 22:37:07 2009 +0500
+++ b/plugins/mod_muc.lua	Tue Jan 13 22:38:20 2009 +0500
@@ -274,7 +274,13 @@
 	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