Mercurial > prosody-hg
comparison plugins/mod_invites.lua @ 13519:0b6af170617b 0.12
mod_invites: Fix traceback when token_info isn’t set
| author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
|---|---|
| date | Wed, 31 Jul 2024 22:06:18 +0200 |
| parents | dcbff9f038a0 |
| children | 662dfff658a0 |
comparison
equal
deleted
inserted
replaced
| 13518:0ef9c26d9d96 | 13519:0b6af170617b |
|---|---|
| 189 username = username; | 189 username = username; |
| 190 inviter = inviter; | 190 inviter = inviter; |
| 191 type = token_info and token_info.type or "roster"; | 191 type = token_info and token_info.type or "roster"; |
| 192 uri = token_info and token_info.uri or get_uri("roster", username.."@"..module.host, token); | 192 uri = token_info and token_info.uri or get_uri("roster", username.."@"..module.host, token); |
| 193 additional_data = token_info and token_info.additional_data or nil; | 193 additional_data = token_info and token_info.additional_data or nil; |
| 194 reusable = token_info.reusable; | 194 reusable = token_info and token_info.reusable or false; |
| 195 }, valid_invite_mt); | 195 }, valid_invite_mt); |
| 196 end | 196 end |
| 197 | 197 |
| 198 function use(token) --luacheck: ignore 131/use | 198 function use(token) --luacheck: ignore 131/use |
| 199 local invite = get(token); | 199 local invite = get(token); |
