throw new URISyntaxException(preferenceUtils.getServer(),
"The XMPP/Jabber server address is invalid: " + serverString); //$NON-NLS-1$
}
ProxyInfo proxyInfo = getProxyInfo(uri.getHost());
ConnectionConfiguration conConfig = null;
if (uri.getPort() < 0) {
conConfig = proxyInfo == null ? new ConnectionConfiguration(
uri.getHost()) : new ConnectionConfiguration(uri.getHost(),
proxyInfo);
} else {
conConfig = proxyInfo == null ? new ConnectionConfiguration(
uri.getHost(), uri.getPort()) : new ConnectionConfiguration(
uri.getHost(), uri.getPort(), proxyInfo);
}
/*
* TODO It has to ask the user, if s/he wants to use non-TLS connections
* with PLAIN SASL if TLS is not supported by the server.
*
* TODO use MessageDialog and Util.runSWTSync() to provide a password
* call-back if the user has no password set in the preferences.
*/
conConfig.setSecurityMode(ConnectionConfiguration.SecurityMode.enabled);
/*
* We handle reconnecting ourselves
*/
conConfig.setReconnectionAllowed(false);
return conConfig;
}