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
commit2f6301bca2108abb064aaf2c2ff7f991e97ce67a (patch)
tree6f1d2172515d10f815b20a2fb998a82cc36d43d2
parent0ae91158e6c464932b6e0f540bc43b0b41ca8191 (diff)
downloadprosody-2f6301bca2108abb064aaf2c2ff7f991e97ce67a.tar.gz
prosody-2f6301bca2108abb064aaf2c2ff7f991e97ce67a.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