#1595 MUC: disco#info queries return an empty node="" attribute if request did not include a node attribute
Reporter
lessthan3
Owner
Zash
Created
Updated
Stars
★ (1)
Tags
Priority-Medium
Type-Defect
Difficulty-Easy
Status-Fixed
Patch
lessthan3
on
What steps will reproduce the problem?
1. Have a MUC component on a prosody server
2. Set up a room
3. Send a disco#info query to that room
What is the expected output?
<iq id="foo" type="result" to="admin@xmpp.example/gajim" from="test@muc.xmpp.example">
<query xmlns="http://jabber.org/protocol/disco#info">
<!-- ... -->
</query>
</iq>
What do you see instead?
<iq id="foo" type="result" to="admin@xmpp.example/gajim" from="test@muc.xmpp.example">
<query xmlns="http://jabber.org/protocol/disco#info" node="">
<!-- ... -->
</query>
</iq>
What version of the product are you using? On what operating system?
Prosody 0.11.5 on GNU/Linux
Please provide any additional information below.
Noticed that Gajim was apparently not properly handling disco#info query responses from MUC's on my service.
I checked trunk and it appears to still be present there, as well.
Zash
on
Thanks for the report!
I have noticed this myself from time to time but it never broke anything for me and I didn't investigate further.
Does this cause problems in some client?
Should be an easy fix in case you would like to try to fix it yourself ;)
Changes
tags Status-Accepted Difficulty-Easy
lessthan3
on
It prevented Gajim from listing the number of occupants my room had, at least. I hadn't noticed any further improper behavior, though.
I did give it a shot at fixing, and it seems that it works alright. Haven't done much extensive testing; hopefully, it's trivial enough to not break anything.
Patch for trunk:
375c375
< local node = stanza.tags[1].attr.node or "";
---
> local node = stanza.tags[1].attr.node;
380c380
< if node ~= "" then
---
> if node and node ~= "" then
Patch for 0.11:
339c339
< local node = stanza.tags[1].attr.node or "";
---
> local node = stanza.tags[1].attr.node;
344c344
< if node ~= "" then
---
> if node and node ~= "" then
lessthan3
on
Forgot to add, ^ these patch plugins/muc/muc.lib.lua
What steps will reproduce the problem? 1. Have a MUC component on a prosody server 2. Set up a room 3. Send a disco#info query to that room What is the expected output? <iq id="foo" type="result" to="admin@xmpp.example/gajim" from="test@muc.xmpp.example"> <query xmlns="http://jabber.org/protocol/disco#info"> <!-- ... --> </query> </iq> What do you see instead? <iq id="foo" type="result" to="admin@xmpp.example/gajim" from="test@muc.xmpp.example"> <query xmlns="http://jabber.org/protocol/disco#info" node=""> <!-- ... --> </query> </iq> What version of the product are you using? On what operating system? Prosody 0.11.5 on GNU/Linux Please provide any additional information below. Noticed that Gajim was apparently not properly handling disco#info query responses from MUC's on my service. I checked trunk and it appears to still be present there, as well.
Thanks for the report! I have noticed this myself from time to time but it never broke anything for me and I didn't investigate further. Does this cause problems in some client? Should be an easy fix in case you would like to try to fix it yourself ;)
ChangesIt prevented Gajim from listing the number of occupants my room had, at least. I hadn't noticed any further improper behavior, though. I did give it a shot at fixing, and it seems that it works alright. Haven't done much extensive testing; hopefully, it's trivial enough to not break anything. Patch for trunk: 375c375 < local node = stanza.tags[1].attr.node or ""; --- > local node = stanza.tags[1].attr.node; 380c380 < if node ~= "" then --- > if node and node ~= "" then Patch for 0.11: 339c339 < local node = stanza.tags[1].attr.node or ""; --- > local node = stanza.tags[1].attr.node; 344c344 < if node ~= "" then --- > if node and node ~= "" then
Forgot to add, ^ these patch plugins/muc/muc.lib.lua
Thanks, added as https://hg.prosody.im/0.11/rev/552cafd30eb2 In the future, try to use the unified diff format, it is easier to work with.
Changes