comparison mod_invites_register/mod_invites_register.lua @ 4121:ee8e7f5196b4

mod_invites_register: Fix traceback for non-invite registrations
author Matthew Wild <mwild1@gmail.com>
date Mon, 14 Sep 2020 15:05:19 +0100
parents d3c7be9e36d9
children 46fb40d7f65a
comparison
equal deleted inserted replaced
4120:d3c7be9e36d9 4121:ee8e7f5196b4
87 local validated_invite = event.validated_invite or (event.session and event.session.validated_invite); 87 local validated_invite = event.validated_invite or (event.session and event.session.validated_invite);
88 if invite_only and not validated_invite then 88 if invite_only and not validated_invite then
89 event.allowed = false; 89 event.allowed = false;
90 event.reason = "Registration on this server is through invitation only"; 90 event.reason = "Registration on this server is through invitation only";
91 return; 91 return;
92 elseif not validated_invite then
93 -- This registration is not using an invite, but
94 -- the server is not in invite-only mode, so nothing
95 -- for this module to do...
96 return;
92 end 97 end
93 if validated_invite and validated_invite.additional_data and validated_invite.additional_data.allow_reset then 98 if validated_invite and validated_invite.additional_data and validated_invite.additional_data.allow_reset then
94 event.allow_reset = validated_invite.additional_data.allow_reset; 99 event.allow_reset = validated_invite.additional_data.allow_reset;
95 end 100 end
96 end); 101 end);