AnsweredAssumed Answered

Smack-4.1.0-rc2: XMPPError does not include conditionText in toXML()

Question asked by Martin on Mar 5, 2015
Latest reply on Mar 6, 2015 by Flow

The PacketParserUtils is now able to parse the condition text e.g. in a redirect error response. However the opposite is still missing: XMPPError.toXML() does not include the conditionText in the produced XML String:

public XmlStringBuilder toXML() {
    XmlStringBuilder xml = new XmlStringBuilder();
    xml.halfOpenElement(ERROR);
    xml.attribute("type", type.toString());
    xml.optAttribute("by", errorGenerator);
    xml.rightAngleBracket();

    xml.halfOpenElement(condition.toString());
    xml.xmlnsAttribute(NAMESPACE);
// here I would insert:
    if (conditionText != null) {
        xml.rightAngleBracket();
        xml.escape(conditionText);
        xml.closeElement(condition.toString());
    } else {
        xml.closeEmptyElement();
    }
// then continue with
    addDescriptiveTextsAndExtensions(xml);

    xml.closeElement(ERROR);
    return xml;
}

 

Martin

Outcomes