comparison mod_invites_tracking/mod_invites_tracking.lua @ 5900:cb3b2fbf57e7

mod_invites_tracking: Fix traceback when not registering via invite (thanks Link Mauve)
author Matthew Wild <mwild1@gmail.com>
date Wed, 08 May 2024 12:48:24 +0100
parents 32f1f18f4874
children 9ed02a4f6ff4
comparison
equal deleted inserted replaced
5899:694b62d8a82f 5900:cb3b2fbf57e7
9 if validated_invite then 9 if validated_invite then
10 invite_source = validated_invite.additional_data and validated_invite.additional_data.source; 10 invite_source = validated_invite.additional_data and validated_invite.additional_data.source;
11 invite_id = validated_invite.token; 11 invite_id = validated_invite.token;
12 end 12 end
13 13
14 tracking_store:set(new_username, {invite_id = validated_invite.token, invite_source = invite_source}); 14 tracking_store:set(new_username, {invite_id = invite_id, invite_source = invite_source});
15 module:log("debug", "recorded that invite from %s was used to create %s", invite_source, new_username) 15 module:log("debug", "recorded that invite from %s was used to create %s", invite_source, new_username)
16 end); 16 end);
17 17
18 -- " " is an invalid localpart -> we can safely use it for store metadata 18 -- " " is an invalid localpart -> we can safely use it for store metadata
19 tracking_store:set(" ", {version="1"}); 19 tracking_store:set(" ", {version="1"});