Mercurial > prosody-hg
comparison plugins/muc/muc.lib.lua @ 4201:9a8d2baf7a9c
MUC: Add a textual error message when the user isn't allowed to get/set config form.
| author | Waqas Hussain <waqas20@gmail.com> |
|---|---|
| date | Thu, 24 Feb 2011 07:09:38 +0500 |
| parents | adcfd525f329 |
| children | dff7df4a191b |
comparison
equal
deleted
inserted
replaced
| 4199:43cf7d96956f | 4201:9a8d2baf7a9c |
|---|---|
| 796 elseif type == "set" or type == "get" then | 796 elseif type == "set" or type == "get" then |
| 797 origin.send(st.error_reply(stanza, "cancel", "bad-request")); | 797 origin.send(st.error_reply(stanza, "cancel", "bad-request")); |
| 798 end | 798 end |
| 799 elseif xmlns == "http://jabber.org/protocol/muc#owner" and (type == "get" or type == "set") and stanza.tags[1].name == "query" then | 799 elseif xmlns == "http://jabber.org/protocol/muc#owner" and (type == "get" or type == "set") and stanza.tags[1].name == "query" then |
| 800 if self:get_affiliation(stanza.attr.from) ~= "owner" then | 800 if self:get_affiliation(stanza.attr.from) ~= "owner" then |
| 801 origin.send(st.error_reply(stanza, "auth", "forbidden")); | 801 origin.send(st.error_reply(stanza, "auth", "forbidden", "Only owners can configure rooms")); |
| 802 elseif stanza.attr.type == "get" then | 802 elseif stanza.attr.type == "get" then |
| 803 self:send_form(origin, stanza); | 803 self:send_form(origin, stanza); |
| 804 elseif stanza.attr.type == "set" then | 804 elseif stanza.attr.type == "set" then |
| 805 local child = stanza.tags[1].tags[1]; | 805 local child = stanza.tags[1].tags[1]; |
| 806 if not child then | 806 if not child then |
