Mercurial > prosody-hg
comparison 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 |
| parents | f9af31dbfeb8 |
| children | dbbb5ed41365 f76139aa7cd5 |
comparison
equal
deleted
inserted
replaced
| 2173:f9af31dbfeb8 | 2174:13375e6c4ecb |
|---|---|
| 527 else | 527 else |
| 528 local from = stanza.attr.from; | 528 local from = stanza.attr.from; |
| 529 stanza.attr.from = current_nick; | 529 stanza.attr.from = current_nick; |
| 530 local subject = getText(stanza, {"subject"}); | 530 local subject = getText(stanza, {"subject"}); |
| 531 if subject then | 531 if subject then |
| 532 self:set_subject(current_nick, subject); -- TODO use broadcast_message_stanza | 532 if occupant.role == "moderator" then |
| 533 self:set_subject(current_nick, subject); -- TODO use broadcast_message_stanza | |
| 534 else | |
| 535 stanza.attr.from = from; | |
| 536 origin.send(st.error_reply(stanza, "cancel", "forbidden")); | |
| 537 end | |
| 533 else | 538 else |
| 534 self:broadcast_message(stanza, true); | 539 self:broadcast_message(stanza, true); |
| 535 end | 540 end |
| 536 stanza.attr.from = from; | 541 stanza.attr.from = from; |
| 537 end | 542 end |
