Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MultiUserChat.SubmitRoomConfigForm bug #51

Open
cimframe opened this issue Feb 9, 2017 · 0 comments
Open

MultiUserChat.SubmitRoomConfigForm bug #51

cimframe opened this issue Feb 9, 2017 · 0 comments

Comments

@cimframe
Copy link

cimframe commented Feb 9, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant