# HG changeset patch
# User Matthew Wild <mwild1@gmail.com>
# Date 1536847868 -3600
# Node ID 2466b533f63d8eb4b4a67b14d2a312b7cefb7810
# Parent  2d71040a959f3ae0a25e7f76a89a67da45e31a14
MUC: Fix to correctly return 'node' in disco#info responses (thanks jc)

diff -r 2d71040a959f -r 2466b533f63d plugins/muc/muc.lib.lua
--- a/plugins/muc/muc.lib.lua	Thu Sep 13 14:46:24 2018 +0100
+++ b/plugins/muc/muc.lib.lua	Thu Sep 13 15:11:08 2018 +0100
@@ -337,7 +337,7 @@
 
 function room_mt:get_disco_info(stanza)
 	local node = stanza.tags[1].attr.node or "";
-	local reply = st.reply(stanza):query("http://jabber.org/protocol/disco#info", { node = node });
+	local reply = st.reply(stanza):tag("query", { xmlns = "http://jabber.org/protocol/disco#info", node = node });
 	local event_name = "muc-disco#info";
 	local event_data = { room = self, reply = reply, stanza = stanza };
 
diff -r 2d71040a959f -r 2466b533f63d spec/scansion/muc_register.scs
--- a/spec/scansion/muc_register.scs	Thu Sep 13 14:46:24 2018 +0100
+++ b/spec/scansion/muc_register.scs	Thu Sep 13 15:11:08 2018 +0100
@@ -132,7 +132,7 @@
 
 Juliet receives:
 	<iq type='result' from='room@conference.localhost' id='getnick1'>
-		<query xmlns='http://jabber.org/protocol/disco#info'>
+		<query xmlns='http://jabber.org/protocol/disco#info' node='x-roomuser-item'>
 			<identity category='conference' name='Juliet' type='text'/>
 		</query>
 	</iq>
@@ -286,6 +286,20 @@
 Romeo receives:
 	<presence from="room@conference.localhost/Juliet" />
 
+# Romeo checks whether he has reserved his own nick yet
+
+Romeo sends:
+	<iq id='getnick1' to='room@conference.localhost' type='get'>
+		<query xmlns='http://jabber.org/protocol/disco#info' node='x-roomuser-item'/>
+	</iq>
+
+# But no nick is returned, as he hasn't registered yet!
+
+Romeo receives:
+	<iq type='result' from='room@conference.localhost' id='getnick1'>
+		<query xmlns='http://jabber.org/protocol/disco#info' node='x-roomuser-item' scansion:strict='true' />
+	</iq>
+
 # Romeo updates his own registration
 	
 Romeo sends:
@@ -346,7 +360,7 @@
 
 Romeo receives:
 	<iq type='result' from='room@conference.localhost' id='getnick1'>
-		<query xmlns='http://jabber.org/protocol/disco#info'>
+		<query xmlns='http://jabber.org/protocol/disco#info' node='x-roomuser-item'>
 			<identity category='conference' name='Romeo' type='text'/>
 		</query>
 	</iq>