Mercurial > prosody-modules
comparison mod_invites_tracking/mod_invites_tracking.lua @ 5901:9ed02a4f6ff4
mod_invites_tracking: Don't bother storing anything for non-invite IBR
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Wed, 08 May 2024 12:48:41 +0100 |
| parents | cb3b2fbf57e7 |
| children |
comparison
equal
deleted
inserted
replaced
| 5900:cb3b2fbf57e7 | 5901:9ed02a4f6ff4 |
|---|---|
| 1 local tracking_store = module:open_store("invites_tracking"); | 1 local tracking_store = module:open_store("invites_tracking"); |
| 2 | 2 |
| 3 module:hook("user-registered", function(event) | 3 module:hook("user-registered", function(event) |
| 4 local validated_invite = event.validated_invite or (event.session and event.session.validated_invite); | 4 local validated_invite = event.validated_invite or (event.session and event.session.validated_invite); |
| 5 local new_username = event.username; | 5 local new_username = event.username; |
| 6 | |
| 7 if not validated_invite then | |
| 8 module:log("debug", "No invitation found for registration of %s", new_username); | |
| 9 return; | |
| 10 end | |
| 6 | 11 |
| 7 local invite_id = nil; | 12 local invite_id = nil; |
| 8 local invite_source = nil; | 13 local invite_source = nil; |
| 9 if validated_invite then | 14 if validated_invite then |
| 10 invite_source = validated_invite.additional_data and validated_invite.additional_data.source; | 15 invite_source = validated_invite.additional_data and validated_invite.additional_data.source; |
