plugins/muc/muc.lib: Allow users with affiliations to invite while not in room themselves
authordaurnimator <quae@daurnimator.com>
Wed, 19 Mar 2014 17:50:00 -0400
changeset 6127 a66ebc5d0ab5
parent 6126 122e0f26e8f6
child 6128 8a71a1c34202
plugins/muc/muc.lib: Allow users with affiliations to invite while not in room themselves
plugins/muc/muc.lib.lua
--- a/plugins/muc/muc.lib.lua	Wed Mar 19 17:46:25 2014 -0400
+++ b/plugins/muc/muc.lib.lua	Wed Mar 19 17:50:00 2014 -0400
@@ -986,7 +986,7 @@
 	local _from, _to = stanza.attr.from, stanza.attr.to;
 	local current_nick = self:get_occupant_jid(_from)
 	-- Need visitor role or higher to invite
-	if not self._occupants[current_nick].role then
+	if not self:get_role(current_nick) or not self:get_default_role(self:get_affiliation(_from)) then
 		origin.send(st.error_reply(stanza, "auth", "forbidden"));
 		return true;
 	end