aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-05-21 15:52:20 +0100
committerMatthew Wild <mwild1@gmail.com>2009-05-21 15:52:20 +0100
commitf8ae6f9dd577ea3c8307bda938262179466f4336 (patch)
treed8f13ce5756f3ff4e8bb7038b39994c2866e00f4 /plugins
parent6b5592e19879047d6e3cd738862a5a155d53f98c (diff)
downloadprosody-f8ae6f9dd577ea3c8307bda938262179466f4336.tar.gz
prosody-f8ae6f9dd577ea3c8307bda938262179466f4336.zip
mod_register: Attach session to user-registered and user-deregistered events
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_register.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/mod_register.lua b/plugins/mod_register.lua
index 417e36bd..43124ff9 100644
--- a/plugins/mod_register.lua
+++ b/plugins/mod_register.lua
@@ -61,7 +61,7 @@ module:add_iq_handler("c2s", "jabber:iq:register", function (session, stanza)
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 @@ module:add_iq_handler("c2s_unauthed", "jabber:iq:register", function (session, s
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"));