Mercurial > prosody-hg
comparison plugins/muc/subject.lib.lua @ 8850:26f1a49fa9c0
MUC: Include a human-readable error message when not allowed to change subject
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Fri, 01 Jun 2018 08:47:07 +0200 |
| parents | cd186331ab1f |
| children | a387e00471d6 |
comparison
equal
deleted
inserted
replaced
| 8849:cd186331ab1f | 8850:26f1a49fa9c0 |
|---|---|
| 99 ( role_rank >= valid_roles.participant and get_changesubject(room) ) then -- and participant | 99 ( role_rank >= valid_roles.participant and get_changesubject(room) ) then -- and participant |
| 100 set_subject(room, occupant.nick, subject:get_text()); | 100 set_subject(room, occupant.nick, subject:get_text()); |
| 101 room:save(); | 101 room:save(); |
| 102 return true; | 102 return true; |
| 103 else | 103 else |
| 104 event.origin.send(st.error_reply(stanza, "auth", "forbidden")); | 104 event.origin.send(st.error_reply(stanza, "auth", "forbidden", "You are not allowed to change the subject")); |
| 105 return true; | 105 return true; |
| 106 end | 106 end |
| 107 end | 107 end |
| 108 end, 20); | 108 end, 20); |
| 109 | 109 |
