aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2014-03-19 17:30:21 -0400
committerdaurnimator <quae@daurnimator.com>2014-03-19 17:30:21 -0400
commitfd4a486166f340c736f15636ff5dc3940a806995 (patch)
tree6f1d2172515d10f815b20a2fb998a82cc36d43d2
parentc6d4ea2e3b5db640310d5cb7b5d1b8b27fc7c831 (diff)
downloadprosody-fd4a486166f340c736f15636ff5dc3940a806995.tar.gz
prosody-fd4a486166f340c736f15636ff5dc3940a806995.zip
plugins/muc/muc.lib: Check role instead of current_nick
-rw-r--r--plugins/muc/muc.lib.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua
index be4d31c3..7b010646 100644
--- a/plugins/muc/muc.lib.lua
+++ b/plugins/muc/muc.lib.lua
@@ -987,7 +987,8 @@ function room_mt:handle_mediated_invite(origin, stanza)
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