aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/muc/muc.lib.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-06-18 04:25:01 +0200
committerKim Alvefur <zash@zash.se>2018-06-18 04:25:01 +0200
commitbf2c33a73eb03f04a212888be627e9c7b9651cd9 (patch)
tree56707456772fe90ffa7e7f5edee79978f527a5e2 /plugins/muc/muc.lib.lua
parenta062706194343729427d4450bbf0e9cd6c4e9215 (diff)
downloadprosody-bf2c33a73eb03f04a212888be627e9c7b9651cd9.tar.gz
prosody-bf2c33a73eb03f04a212888be627e9c7b9651cd9.zip
MUC: Normalize role value, fixes removal on loss of membership (thanks mimi89999)
Diffstat (limited to 'plugins/muc/muc.lib.lua')
-rw-r--r--plugins/muc/muc.lib.lua1
1 files changed, 1 insertions, 0 deletions
diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua
index c925329f..09cc237a 100644
--- a/plugins/muc/muc.lib.lua
+++ b/plugins/muc/muc.lib.lua
@@ -51,6 +51,7 @@ function room_mt:get_default_role(affiliation)
affiliation = affiliation;
affiliation_rank = valid_affiliations[affiliation or "none"];
});
+ role = role ~= "none" and role or nil; -- coerces `role == false` to `nil`
return role, valid_roles[role or "none"];
end
module:hook("muc-get-default-role", function(event)