Mercurial > prosody-modules
comparison mod_invites/mod_invites.lua @ 5948:8ac59766ece1
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 | 2047dd56cc40 |
children |
comparison
equal
deleted
inserted
replaced
5947:22effe87fed2 | 5948:8ac59766ece1 |
---|---|
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); |