Diff

plugins/mod_muc.lua @ 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
parent 707:bb9583314ec7
child 752:a9642c1d5827
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