Software /
code /
prosody
Diff
plugins/muc/muc.lib.lua @ 2174:13375e6c4ecb
MUC: Only allow moderators to change the room subject.
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Wed, 25 Nov 2009 22:00:33 +0500 |
parent | 2173:f9af31dbfeb8 |
child | 2216:dbbb5ed41365 |
child | 2845:f76139aa7cd5 |
line wrap: on
line diff
--- a/plugins/muc/muc.lib.lua Wed Nov 25 21:42:05 2009 +0500 +++ b/plugins/muc/muc.lib.lua Wed Nov 25 22:00:33 2009 +0500 @@ -529,7 +529,12 @@ 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