Mercurial > prosody-modules
diff mod_register_json/mod_register_json.lua @ 551:859bf77b9fbf
mod_register_json: fire user-registered event manually on the destination host. (thanks Mr. Gecko)
author | Marco Cirillo <maranda@lightwitch.org> |
---|---|
date | Sat, 14 Jan 2012 21:45:37 +0000 |
parents | d8143f627f9f |
children | 7310ceb7564f |
line wrap: on
line diff
--- a/mod_register_json/mod_register_json.lua Sat Jan 14 19:56:24 2012 +0000 +++ b/mod_register_json/mod_register_json.lua Sat Jan 14 21:45:37 2012 +0000 @@ -97,7 +97,8 @@ return http_response(406, "Supplied username contains invalid characters, see RFC 6122.") else usermanager.create_user(username, req_body["password"], req_body["host"]) - module:log("debug", "%s registration data submission for %s is successful", user, username) + hosts[req_body["host"]].events.fire_event("user-registered", { username = username, host = req_body["host"], source = "mod_register_json", session = { ip = req_body["ip"] } }) + module:log("debug", "%s registration data submission for %s@%s is successful", user, username, req_body["host"]) return http_response(200, "Done.") end else