Software / code / prosody
Comparison
plugins/mod_invites.lua @ 13355:a6c8a50cdfb5
mod_invites: Fix linter issues
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Wed, 29 Nov 2023 17:50:33 +0000 |
| parent | 13353:27512ebcc8af |
| child | 13410:7efdd143fdfc |
comparison
equal
deleted
inserted
replaced
| 13354:83f3076965f6 | 13355:a6c8a50cdfb5 |
|---|---|
| 208 name = "create_account"; | 208 name = "create_account"; |
| 209 desc = "Create an invitation to make an account on this server with the specified JID (supply only a hostname to allow any username)"; | 209 desc = "Create an invitation to make an account on this server with the specified JID (supply only a hostname to allow any username)"; |
| 210 args = { { name = "user_jid", type = "string" } }; | 210 args = { { name = "user_jid", type = "string" } }; |
| 211 host_selector = "user_jid"; | 211 host_selector = "user_jid"; |
| 212 | 212 |
| 213 handler = function (self, user_jid) | 213 handler = function (self, user_jid) --luacheck: ignore 212/self |
| 214 local username, host = jid_split(user_jid); | 214 local username = jid_split(user_jid); |
| 215 local invite, err = create_account(username); | 215 local invite, err = create_account(username); |
| 216 if not invite then return nil, err; end | 216 if not invite then return nil, err; end |
| 217 return true, invite.landing_page or invite.uri; | 217 return true, invite.landing_page or invite.uri; |
| 218 end; | 218 end; |
| 219 }); | 219 }); |
| 224 name = "create_contact"; | 224 name = "create_contact"; |
| 225 desc = "Create an invitation to become contacts with the specified user"; | 225 desc = "Create an invitation to become contacts with the specified user"; |
| 226 args = { { name = "user_jid", type = "string" }, { name = "allow_registration" } }; | 226 args = { { name = "user_jid", type = "string" }, { name = "allow_registration" } }; |
| 227 host_selector = "user_jid"; | 227 host_selector = "user_jid"; |
| 228 | 228 |
| 229 handler = function (self, user_jid, allow_registration) | 229 handler = function (self, user_jid, allow_registration) --luacheck: ignore 212/self |
| 230 local username, host = jid_split(user_jid); | 230 local username = jid_split(user_jid); |
| 231 local invite, err = create_contact(username, allow_registration); | 231 local invite, err = create_contact(username, allow_registration); |
| 232 if not invite then return nil, err; end | 232 if not invite then return nil, err; end |
| 233 return true, invite.landing_page or invite.uri; | 233 return true, invite.landing_page or invite.uri; |
| 234 end; | 234 end; |
| 235 }); | 235 }); |