# HG changeset patch
# User Kim Alvefur <zash@zash.se>
# Date 1457344777 -3600
# Node ID 80923a1a8fe1a059825ef3836ea31f2eeee06f5a
# Parent  210d8329dc70d7d6644da079064aeea44f9e335c
MUC: Don't reply to error stanzas with more error stanzas (thanks woffs)

diff -r 210d8329dc70 -r 80923a1a8fe1 plugins/muc/mod_muc.lua
--- a/plugins/muc/mod_muc.lua	Sun Mar 06 18:52:22 2016 +0100
+++ b/plugins/muc/mod_muc.lua	Mon Mar 07 10:59:37 2016 +0100
@@ -255,9 +255,11 @@
 			-- Watch presence to create rooms
 			if stanza.attr.type == nil and stanza.name == "presence" then
 				room = muclib.new_room(room_jid);
-			else
+			elseif stanza.attr.type ~= "error" then
 				origin.send(st.error_reply(stanza, "cancel", "not-allowed"));
 				return true;
+			else
+				return;
 			end
 		end
 		return room[method](room, origin, stanza);