// processing xml:lang
String xmlLang = stanza.getXMLLang();
sessionContext.setXMLLang(xmlLang);
// processing version
XMPPVersion responseVersion = null;
// if version is not present, version "0.0" is assumed, represented by NULL.
String versionAttributeValue = stanza.getAttributeValue("version");
if (versionAttributeValue != null) {
XMPPVersion clientVersion;
try {
clientVersion = new XMPPVersion(versionAttributeValue);
} catch (IllegalArgumentException e) {
// version string does not conform to spec
return respondUnsupportedVersionError(xmlLang, versionAttributeValue, "illegal version value: ");
}
// check if version is supported
if (!clientVersion.equals(XMPPVersion.VERSION_1_0)) {
if (clientVersion.getMajor() == XMPPVersion.VERSION_1_0.getMajor()) {
// we live with the higher minor version, but only support ours
responseVersion = XMPPVersion.VERSION_1_0;
} else {
// we do not support major changes, as of RFC3920
return respondUnsupportedVersionError(xmlLang, versionAttributeValue,