aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2009-11-25 21:42:05 +0500
committerWaqas Hussain <waqas20@gmail.com>2009-11-25 21:42:05 +0500
commit3238abd1047fdc5e1e9336177bbc80e2ea6650ae (patch)
treea6cbbfb0e9494be71a9a4559b39817bf5a563efb /plugins
parentd689a0035c03983aeb4fc30605d616af6855799e (diff)
downloadprosody-3238abd1047fdc5e1e9336177bbc80e2ea6650ae.tar.gz
prosody-3238abd1047fdc5e1e9336177bbc80e2ea6650ae.zip
MUC: Prevent visitors from broadcasting messages.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/muc/muc.lib.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua
index 0fb5223d..7907c0c3 100644
--- a/plugins/muc/muc.lib.lua
+++ b/plugins/muc/muc.lib.lua
@@ -519,8 +519,11 @@ function room_mt:handle_to_room(origin, stanza) -- presence changes and groupcha
local from, to = stanza.attr.from, stanza.attr.to;
local room = jid_bare(to);
local current_nick = self._jid_nick[from];
- if not current_nick then -- not in room
+ local occupant = self._occupants[current_nick];
+ if not occupant then -- not in room
origin.send(st.error_reply(stanza, "cancel", "not-acceptable"));
+ elseif occupant.role == "visitor" then
+ origin.send(st.error_reply(stanza, "cancel", "forbidden"));
else
local from = stanza.attr.from;
stanza.attr.from = current_nick;