powered by Jive Software

Smack 4.4.4: smack Jingle.getIQChildElementBuilder() returned xml contains an invalid JingleAction

The Jingle#getIQChildElementBuilder() returns incorrect xml contains an invalid value for ‘action’ in jingle stanza e.g. action=‘session_accept’ instead of action=‘session-accept’

The reason is XmlStringBuilder#attribute() uses value.name() instead of value.toString()

    public XmlStringBuilder attribute(String name, Enum<?> value) {
        assert value != null;
        // TODO: Should use toString() instead of name().
        attribute(name, value.name());
        return this;
    }
    protected IQChildElementXmlStringBuilder getIQChildElementBuilder(IQChildElementXmlStringBuilder xml) {
        xml.optAttribute(INITIATOR_ATTRIBUTE_NAME, getInitiator());
        xml.optAttribute(RESPONDER_ATTRIBUTE_NAME, getResponder());
        xml.optAttribute(ACTION_ATTRIBUTE_NAME, getAction());
        xml.optAttribute(SESSION_ID_ATTRIBUTE_NAME, getSid());
        xml.rightAngleBracket();

        xml.optElement(reason);

        xml.append(contents);

        return xml;
    }

1 Like

Created [SMACK-921] Jingle.getIQChildElementBuilder() contains an invalid JingleAction - Ignite Realtime Jira

Should be fixed in the upcoming Smack 4.4.5 version, which I plan to release in the coming weeks.

Just curious, what do yo use Jingle for right now?

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.