aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/muc/muc.lib.lua
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2009-11-25 22:00:33 +0500
committerWaqas Hussain <waqas20@gmail.com>2009-11-25 22:00:33 +0500
commitbdd5151bc7c2f7d6873ca0fa2b06962567811b79 (patch)
tree68d8ed7cd3d69a89abac50469651cf972521d1a5 /plugins/muc/muc.lib.lua
parent3238abd1047fdc5e1e9336177bbc80e2ea6650ae (diff)
downloadprosody-bdd5151bc7c2f7d6873ca0fa2b06962567811b79.tar.gz
prosody-bdd5151bc7c2f7d6873ca0fa2b06962567811b79.zip
MUC: Only allow moderators to change the room subject.
Diffstat (limited to 'plugins/muc/muc.lib.lua')
-rw-r--r--plugins/muc/muc.lib.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua
index 7907c0c3..098fef98 100644
--- a/plugins/muc/muc.lib.lua
+++ b/plugins/muc/muc.lib.lua
@@ -529,7 +529,12 @@ function room_mt:handle_to_room(origin, stanza) -- presence changes and groupcha
stanza.attr.from = current_nick;
local subject = getText(stanza, {"subject"});
if subject then
- self:set_subject(current_nick, subject); -- TODO use broadcast_message_stanza
+ if occupant.role == "moderator" then
+ self:set_subject(current_nick, subject); -- TODO use broadcast_message_stanza
+ else
+ stanza.attr.from = from;
+ origin.send(st.error_reply(stanza, "cancel", "forbidden"));
+ end
else
self:broadcast_message(stanza, true);
end