aboutsummaryrefslogtreecommitdiffstats
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
commit86866da884f2749767404ad5fe025b54d7991b48 (patch)
tree56707456772fe90ffa7e7f5edee79978f527a5e2
parent9c32bebf6f4947699da33c082c4f254ee1fd328b (diff)
downloadprosody-86866da884f2749767404ad5fe025b54d7991b48.tar.gz
prosody-86866da884f2749767404ad5fe025b54d7991b48.zip
MUC: Normalize role value, fixes removal on loss of membership (thanks mimi89999)
-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)