aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_invites.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2023-03-30 11:09:08 +0200
committerKim Alvefur <zash@zash.se>2023-03-30 11:09:08 +0200
commit11ada4e3396b9fdcce0d79c71ec5f4888e5a0e9d (patch)
treec988252a7ba63d8ca207511d0803af37d4aa8b2f /plugins/mod_invites.lua
parent0d140811589f55eac962980bceed6c33b2f18649 (diff)
downloadprosody-11ada4e3396b9fdcce0d79c71ec5f4888e5a0e9d.tar.gz
prosody-11ada4e3396b9fdcce0d79c71ec5f4888e5a0e9d.zip
mod_invites: Record roles as ordered list, first becoming primary role
For mod_invites_register to apply on user creation.
Diffstat (limited to 'plugins/mod_invites.lua')
-rw-r--r--plugins/mod_invites.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/mod_invites.lua b/plugins/mod_invites.lua
index 1d6dd6ba..024b86cf 100644
--- a/plugins/mod_invites.lua
+++ b/plugins/mod_invites.lua
@@ -257,7 +257,7 @@ function module.command(arg)
end
local allow_reset;
- local roles;
+ local roles = {};
local groups = {};
while #arg > 0 do
@@ -282,7 +282,7 @@ function module.command(arg)
print(" --group GROUPID Add the user to the group with the given ID")
print(" Can be specified multiple times")
print()
- print("--role and --admin override each other; the last one wins")
+ print("--role and --admin can be specified multiple times; the first role becomes the primary role, the rest become secondary roles")
print("--group can be specified multiple times; the user will be added to all groups.")
print()
print("--reset and the other options cannot be mixed.")
@@ -297,14 +297,14 @@ function module.command(arg)
end
allow_reset = username;
elseif value == "--admin" then
- roles = { ["prosody:admin"] = true };
+ table.insert(roles, "prosody:admin");
elseif value == "--role" then
local rolename = arg[1];
if not rolename then
print("Please supply a role name");
return 2;
end
- roles = { [rolename] = true };
+ table.insert(roles, rolename);
table.remove(arg, 1);
elseif value == "--group" or value == "-g" then
local groupid = arg[1];