1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-21 22:02:06 +01:00

Remove setting to disable legacy session establishment

This commit is contained in:
Florian Schmaus 2018-04-02 13:27:01 +02:00
parent ad87243060
commit b443958bee
2 changed files with 1 additions and 43 deletions

View file

@ -550,10 +550,7 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
Session.Feature sessionFeature = getFeature(Session.ELEMENT, Session.NAMESPACE);
// Only bind the session if it's announced as stream feature by the server, is not optional and not disabled
// For more information see http://tools.ietf.org/html/draft-cridland-xmpp-session-01
// TODO remove this suppression once "disable legacy session" code has been removed from Smack
@SuppressWarnings("deprecation")
boolean legacySessionDisabled = getConfiguration().isLegacySessionDisabled();
if (sessionFeature != null && !sessionFeature.isOptional() && !legacySessionDisabled) {
if (sessionFeature != null && !sessionFeature.isOptional()) {
Session session = new Session();
packetCollector = createStanzaCollectorAndSend(new StanzaIdFilter(session), session);
packetCollector.nextResultOrThrow();

View file

@ -32,7 +32,6 @@ import javax.net.ssl.X509TrustManager;
import javax.security.auth.callback.CallbackHandler;
import org.jivesoftware.smack.debugger.SmackDebuggerFactory;
import org.jivesoftware.smack.packet.Session;
import org.jivesoftware.smack.proxy.ProxyInfo;
import org.jivesoftware.smack.sasl.SASLMechanism;
import org.jivesoftware.smack.sasl.core.SASLAnonymous;
@ -100,7 +99,6 @@ public abstract class ConnectionConfiguration {
*/
private final boolean sendPresence;
private final boolean legacySessionDisabled;
private final SecurityMode securityMode;
private final DnssecMode dnssecMode;
@ -159,7 +157,6 @@ public abstract class ConnectionConfiguration {
enabledSSLCiphers = builder.enabledSSLCiphers;
hostnameVerifier = builder.hostnameVerifier;
sendPresence = builder.sendPresence;
legacySessionDisabled = builder.legacySessionDisabled;
debuggerFactory = builder.debuggerFactory;
allowNullOrEmptyUsername = builder.allowEmptyOrNullUsername;
enabledSaslMechanisms = builder.enabledSaslMechanisms;
@ -291,20 +288,6 @@ public abstract class ConnectionConfiguration {
return debuggerFactory;
}
/**
* Returns true if a {@link Session} will be requested on login if the server
* supports it. Although this was mandatory on RFC 3921, RFC 6120/6121 don't
* even mention this part of the protocol.
*
* @return true if a session has to be requested when logging in.
* @deprecated Smack processes the 'optional' element of the session stream feature.
* @see Builder#setLegacySessionDisabled(boolean)
*/
@Deprecated
public boolean isLegacySessionDisabled() {
return legacySessionDisabled;
}
/**
* Returns a CallbackHandler to obtain information, such as the password or
* principal information during the SASL authentication. A CallbackHandler
@ -517,7 +500,6 @@ public abstract class ConnectionConfiguration {
private String password;
private Resourcepart resource;
private boolean sendPresence = true;
private boolean legacySessionDisabled = false;
private ProxyInfo proxy;
private CallbackHandler callbackHandler;
private SmackDebuggerFactory debuggerFactory;
@ -777,27 +759,6 @@ public abstract class ConnectionConfiguration {
return getThis();
}
/**
* Sets if a {@link Session} will be requested on login if the server supports
* it. Although this was mandatory on RFC 3921, RFC 6120/6121 don't even
* mention this part of the protocol.
* <p>
* Deprecation notice: This setting is no longer required in most cases because Smack processes the 'optional'
* element eventually found in the session stream feature. See also <a
* href="https://tools.ietf.org/html/draft-cridland-xmpp-session-01">Here Lies Extensible Messaging and Presence
* Protocol (XMPP) Session Establishment</a>
* </p>
*
* @param legacySessionDisabled if a session has to be requested when logging in.
* @return a reference to this builder.
* @deprecated Smack processes the 'optional' element of the session stream feature.
*/
@Deprecated
public B setLegacySessionDisabled(boolean legacySessionDisabled) {
this.legacySessionDisabled = legacySessionDisabled;
return getThis();
}
/**
* Sets if an initial available presence will be sent to the server. By default
* an available presence will be sent to the server indicating that this presence