Software / code / prosody
Comparison
plugins/mod_invites_register.lua @ 13849:068e77bf91b9 13.0
mod_invites_register: Don't restrict username for roster invites (thanks lissine)
The username field of roster invites is the username of the inviter. It is not
possible for a roster invite to restrict the registration username.
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Wed, 16 Apr 2025 12:02:31 +0100 |
| parent | 13843:87dd8639f08f |
comparison
equal
deleted
inserted
replaced
| 13847:cbd234461c41 | 13849:068e77bf91b9 |
|---|---|
| 101 -- for this module to do... | 101 -- for this module to do... |
| 102 return; | 102 return; |
| 103 end | 103 end |
| 104 if validated_invite then | 104 if validated_invite then |
| 105 local username = validated_invite.username; | 105 local username = validated_invite.username; |
| 106 if username and username ~= event.username then | 106 if validated_invite.type ~= "roster" and username and username ~= event.username then |
| 107 event.allowed = false; | 107 event.allowed = false; |
| 108 event.reason = "The chosen username is not valid with this invitation"; | 108 event.reason = "The chosen username is not valid with this invitation"; |
| 109 end | 109 end |
| 110 local reset_username = validated_invite.additional_data and validated_invite.additional_data.allow_reset; | 110 local reset_username = validated_invite.additional_data and validated_invite.additional_data.allow_reset; |
| 111 if reset_username then | 111 if reset_username then |