pgstath / Sharp.Xmpp

Sharp.Xmpp is looking for a maintainer! Unfortunatelly I do not have currently the time needed to maintain the library. Luckily a small but vibrant community has evolved around Sharp.Xmpp. If you would like to be the project's maintainer please sent an email to pgstath@gmail.com. This should include issues, tickets and commits that you have done for Sharp.Xmpp or other similar project. Sharp.Xmpp is a multiplatform, Windows and Android, .NET XMPP client assembly.Sharp.Xmpp supports IM functionality & a variety of XMPP extensions, is simple and is extensively tested against Android Xamarin. It is a fork of the currently frozen excellent S22.Xmpp project. Sharp.Xmpp will be at the FOSSDEM 2016 Real time DevRoom!
Other
84 stars 51 forks source link

MultiUserChat.SubmitRoomConfigForm bug #51

Open cimframe opened 7 years ago

cimframe commented 7 years ago

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 smiller@scayl.com. Cheers.