plugins/mod_register.lua

changeset 1189
63ed3902f357
parent 1184
fa6df7e83fb3
child 1523
841d61be198f
--- a/plugins/mod_register.lua	Wed May 20 05:23:30 2009 +0500
+++ b/plugins/mod_register.lua	Thu May 21 15:52:20 2009 +0100
@@ -61,7 +61,7 @@
 				end
 				datamanager.store(username, host, "accounts", nil); -- delete accounts datastore at the end
 				module:log("info", "User removed their account: %s@%s", username, host);
-				module:fire_event("user-deregistered", { username = username, host = host, source = "mod_register" });
+				module:fire_event("user-deregistered", { username = username, host = host, source = "mod_register", session = session });
 			else
 				local username = query:child_with_name("username");
 				local password = query:child_with_name("password");
@@ -147,7 +147,8 @@
 							session.send(st.reply(stanza)); -- user created!
 							module:log("info", "User account created: %s@%s", username, session.host);
 							module:fire_event("user-registered", { 
-								username = username, host = session.host, source = "mod_register" });
+								username = username, host = session.host, source = "mod_register",
+								session = session });
 						else
 							-- TODO unable to write file, file may be locked, etc, what's the correct error?
 							session.send(st.error_reply(stanza, "wait", "internal-server-error"));

mercurial