Diff

plugins/muc/muc.lib.lua @ 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
parent 8914:e9acb928c637
child 8931:ae84911c1441
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)