// only include <features> if the other server support version 1.0
if(XMPPVersion.VERSION_1_0.equals(version)) {
XMLElementBuilder featureBuilder = new XMLElementBuilder("features", NamespaceURIs.HTTP_ETHERX_JABBER_ORG_STREAMS);
if (sessionContext.getState() == SessionState.INITIATED) {
if(tlsConfigured) {
featureBuilder.startInnerElement("starttls", NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_TLS).endInnerElement();
}
featureBuilder.startInnerElement("dialback", NamespaceURIs.URN_XMPP_FEATURES_DIALBACK).endInnerElement();
} else if (sessionContext.getState() == SessionState.ENCRYPTED) {
featureBuilder.startInnerElement("dialback", NamespaceURIs.URN_XMPP_FEATURES_DIALBACK).endInnerElement();