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

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

Thanks for reporting. Fixed with Include conditionText in XMPPError.toXML() · 9c5b7d2 · Flowdalic/Smack · GitHub