Comparison

mod_invite/mod_invite.lua @ 3480:5911030a1a66

mod_invite: Fire event that signals that an user has registered (thanks jeybe) This allows other modules to see this and do things, eg mod_watchregistrations
author Kim Alvefur <zash@zash.se>
date Thu, 07 Mar 2019 22:36:30 +0100
parent 2616:c814c667d4d1
child 3549:b059a3fb2a58
comparison
equal deleted inserted replaced
3479:9ef309fb501d 3480:5911030a1a66
107 107
108 tokens[token] = nil; 108 tokens[token] = nil;
109 109
110 invite_storage:set(nil, tokens); 110 invite_storage:set(nil, tokens);
111 111
112 module:fire_event("user-registered", {
113 username = prepped_username, host = module.host, source = "mod_invite", });
114
112 return apply_template(template, { classes = "alert-success", 115 return apply_template(template, { classes = "alert-success",
113 message = "Your account has been created! You can now log in using an XMPP client." }) 116 message = "Your account has been created! You can now log in using an XMPP client." })
114 else 117 else
115 module:log("debug", "Registration failed: " .. tostring(err)); 118 module:log("debug", "Registration failed: " .. tostring(err));
116 119