Comparison

plugins/mod_register.lua @ 8194:ba9cd8447578

mod_register: Add comments saying which section handles password change, account deletion and which is in-band registration
author Kim Alvefur <zash@zash.se>
date Thu, 24 Aug 2017 21:51:11 +0200
parent 8192:4354f556c5db
child 8452:4796fdcb7146
comparison
equal deleted inserted replaced
8193:bb0118e46c45 8194:ba9cd8447578
89 end 89 end
90 90
91 features:add_child(register_stream_feature); 91 features:add_child(register_stream_feature);
92 end); 92 end);
93 93
94 -- Password change and account deletion handler
94 local function handle_registration_stanza(event) 95 local function handle_registration_stanza(event)
95 local session, stanza = event.origin, event.stanza; 96 local session, stanza = event.origin, event.stanza;
96 local log = session.log or module._log; 97 local log = session.log or module._log;
97 98
98 local query = stanza.tags[1]; 99 local query = stanza.tags[1];
205 end 206 end
206 throttle_cache:set(ip, throttle); 207 throttle_cache:set(ip, throttle);
207 return throttle:poll(1); 208 return throttle:poll(1);
208 end 209 end
209 210
211 -- In-band registration
210 module:hook("stanza/iq/jabber:iq:register:query", function(event) 212 module:hook("stanza/iq/jabber:iq:register:query", function(event)
211 local session, stanza = event.origin, event.stanza; 213 local session, stanza = event.origin, event.stanza;
212 local log = session.log or module._log; 214 local log = session.log or module._log;
213 215
214 if not(allow_registration) or session.type ~= "c2s_unauthed" then 216 if not(allow_registration) or session.type ~= "c2s_unauthed" then