diff --git a/smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java b/smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java index 38421ac89..9c3c5bc78 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java @@ -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(); diff --git a/smack-core/src/main/java/org/jivesoftware/smack/ConnectionConfiguration.java b/smack-core/src/main/java/org/jivesoftware/smack/ConnectionConfiguration.java index b81052e30..da888e044 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/ConnectionConfiguration.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/ConnectionConfiguration.java @@ -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. - *

- * 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 Here Lies Extensible Messaging and Presence - * Protocol (XMPP) Session Establishment - *

- * - * @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