Changeset

6124:203f2b4933b0

plugins/muc/muc.lib: Check role instead of current_nick
author daurnimator <quae@daurnimator.com>
date Wed, 19 Mar 2014 17:30:21 -0400
parents 6123:7f82bbd249fe
children 6125:4a35a0281d8a
files plugins/muc/muc.lib.lua
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/muc/muc.lib.lua	Wed Mar 19 16:28:11 2014 -0400
+++ b/plugins/muc/muc.lib.lua	Wed Mar 19 17:30:21 2014 -0400
@@ -987,7 +987,8 @@
 	local payload = stanza:get_child("x", "http://jabber.org/protocol/muc#user"):get_child("invite")
 	local _from, _to = stanza.attr.from, stanza.attr.to;
 	local current_nick = self:get_occupant_jid(_from)
-	if not current_nick then -- Should be in room to send invite TODO: allow admins to send at any time
+	-- Need visitor role or higher to invite
+	if not self._occupants[current_nick].role then
 		origin.send(st.error_reply(stanza, "auth", "forbidden"));
 		return true;
 	end