Changeset

8915:2502be210a85

MUC: Normalize role value, fixes removal on loss of membership (thanks mimi89999)
author Kim Alvefur <zash@zash.se>
date Mon, 18 Jun 2018 04:25:01 +0200
parents 8914:e9acb928c637
children 8916:e727747279a0
files plugins/muc/muc.lib.lua
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/muc/muc.lib.lua	Fri Mar 09 19:03:50 2018 +0100
+++ b/plugins/muc/muc.lib.lua	Mon Jun 18 04:25:01 2018 +0200
@@ -51,6 +51,7 @@
 		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)