Mercurial > prosody-hg
comparison plugins/muc/muc.lib.lua @ 6828:9019bc4c9a5a
MUC: Prevent double replies when MUC affiliation/role change requests fail.
| author | Lance Stout <lancestout@gmail.com> |
|---|---|
| date | Thu, 17 Sep 2015 13:02:09 -0700 |
| parents | 19c4532946b3 |
| children | 3afb8aa78069 |
comparison
equal
deleted
inserted
replaced
| 6827:19c4532946b3 | 6828:9019bc4c9a5a |
|---|---|
| 745 elseif item.attr.role and item.attr.nick and not item.attr.affiliation then | 745 elseif item.attr.role and item.attr.nick and not item.attr.affiliation then |
| 746 success, errtype, err = self:set_role(actor, self.jid.."/"..item.attr.nick, item.attr.role, reason); | 746 success, errtype, err = self:set_role(actor, self.jid.."/"..item.attr.nick, item.attr.role, reason); |
| 747 else | 747 else |
| 748 success, errtype, err = nil, "cancel", "bad-request"; | 748 success, errtype, err = nil, "cancel", "bad-request"; |
| 749 end | 749 end |
| 750 if not success then origin.send(st.error_reply(stanza, errtype, err)); end | 750 if not success then |
| 751 origin.send(st.reply(stanza)); | 751 origin.send(st.error_reply(stanza, errtype, err)); |
| 752 else | |
| 753 origin.send(st.reply(stanza)); | |
| 754 end | |
| 752 return true; | 755 return true; |
| 753 end | 756 end |
| 754 | 757 |
| 755 function room_mt:handle_admin_query_get_command(origin, stanza) | 758 function room_mt:handle_admin_query_get_command(origin, stanza) |
| 756 local actor = stanza.attr.from; | 759 local actor = stanza.attr.from; |
