Mercurial > prosody-modules
comparison mod_http_admin_api/mod_http_admin_api.lua @ 4357:a49ca492e621
mod_invites, mod_http_admin_api: Allow specifying multiple groups when creating an invite
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Tue, 19 Jan 2021 20:34:23 +0000 |
| parents | d61d7d30f38d |
| children | d3e0fe470877 |
comparison
equal
deleted
inserted
replaced
| 4356:ab2e15d3f1fa | 4357:a49ca492e621 |
|---|---|
| 114 end | 114 end |
| 115 end | 115 end |
| 116 | 116 |
| 117 local invite; | 117 local invite; |
| 118 if invite_options and invite_options.reusable then | 118 if invite_options and invite_options.reusable then |
| 119 invite = invites.create_group(invite_options.group, invite_options.ttl, { | 119 invite = invites.create_group(invite_options.groups, invite_options.ttl, { |
| 120 source = "admin_api/"..event.session.username; | 120 source = "admin_api/"..event.session.username; |
| 121 }); | 121 }); |
| 122 else | 122 else |
| 123 invite = invites.create_account(nil, { | 123 invite = invites.create_account(nil, { |
| 124 source = "admin_api/"..event.session.username; | 124 source = "admin_api/"..event.session.username; |
| 125 groups = { invite_options.group }; | 125 groups = invite_options.groups; |
| 126 }); | 126 }); |
| 127 end | 127 end |
| 128 if not invite then | 128 if not invite then |
| 129 return 500; | 129 return 500; |
| 130 end | 130 end |
