# HG changeset patch
# User Kim Alvefur <zash@zash.se>
# Date 1531303506 -7200
# Node ID d780c10709c10127d76678be48c78c7db9140239
# Parent  73320e33762da14b866037408d2b1a366defe7aa
MUC: Include redirect in 'gone' error for destroyed rooms

diff -r 73320e33762d -r d780c10709c1 plugins/muc/mod_muc.lua
--- a/plugins/muc/mod_muc.lua	Wed Jul 11 11:50:44 2018 +0200
+++ b/plugins/muc/mod_muc.lua	Wed Jul 11 12:05:06 2018 +0200
@@ -404,6 +404,10 @@
 					room = nil;
 				else
 					local reply = st.error_reply(stanza, "cancel", "gone", room._data.reason)
+					if room._data.newjid then
+						local uri = "xmpp:"..room._data.newjid.."?join";
+						reply:get_child("error"):child_with_name("gone"):text(uri);
+					end
 					event.origin.send(reply);
 					return true;
 				end