MultiUserChat.SubmitRoomConfigForm bug
I'm not sure of how to submit a bug fix, but I have pulled out almost all of my hair trying to figure this one out!
I am running ejabberd v16.12 as the server and the stanza submitted by the method in this report actually crashed the server... When I ran ejabberd in debug mode and looked at the dump it told me there was no type in the <x/> element.
The old code:
// Construct the response element.
var query = Xml.Element ("query", MucNs.NsOwner);
var xml = Xml.Element ("x", MucNs.NsXData);
xml.Child (configForm.ToXmlElement ());
query.Child (configForm);
added two <x/> elements:
<query xmlns="http://jabber.org/protocol/muc#owner">
<x xmlns="jabber:x:data"> <------------
<x type="submit"
xmlns="jabber:x:data">
<field type="text-single"
var="muc#roomconfig_roomname"
xmlns="">
<value>Testing</value>
</field>
</x>
</x>
</query>
The extra <x/> element crashes the server. By changing the above lines to:
// Construct the response element.
var query = Xml.Element ("query", MucNs.NsOwner);
query.Child (configForm.ToXmlElement());
the correct stanza is produced as:
<query xmlns="http://jabber.org/protocol/muc#owner">
<x xmlns="jabber:x:data">
<x type="submit"
xmlns="jabber:x:data">
<field type="text-single"
var="muc#roomconfig_roomname"
xmlns="">
<value>Testing</value>
</field>
</x>
</x>
</query>
and the world continues to revolve and I get to keep the rest of my hair...
If someone would email me directly with any scolding on the correct way to submit changes, you can reach me, Steve, at [email protected]. Cheers.