migutica / jabber-net

Automatically exported from code.google.com/p/jabber-net
Other
0 stars 0 forks source link

IQ.GetErrorResponse produces 2 <error> tags in response #104

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
If you call GetErrorResponse the IQ stanza will look like

<iq id="iq_15" type="error" 
   from="<something>" to="<something>">
   <error />
   <error type="wait" code="500">
     <internal-server-error 
       xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" />
   </error>
   <query ...

The empty <error> stanza is redundant and violates XMPP protocol.

Fix is to modify jabber.protocol.client.IQError constructor to:

        public IQError(XmlDocument doc, string condition) : base(doc)
        {
            this.Type = IQType.error;
            // +To be removed
            //Error e = Error.GetStanzaError(doc, condition);
            //this.AppendChild(e);
            // - To be removed
            this.Error = Error.GetStanzaError(doc, condition);

        }

Original issue reported on code.google.com by indrek.j...@gmail.com on 25 Aug 2010 at 3:54