From 25bcb6b8910a7ce5a02d44e006ef180d19965689 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Sat, 17 Jan 2015 12:34:22 +0100 Subject: [PATCH] Deprecate setLegacySessionDisabled(boolean) --- .../jivesoftware/smack/AbstractXMPPConnection.java | 2 ++ .../jivesoftware/smack/ConnectionConfiguration.java | 11 +++++++++++ 2 files changed, 13 insertions(+) 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 4f415c763..072025894 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java @@ -466,6 +466,8 @@ public abstract class AbstractXMPPConnection implements XMPPConnection { return user; } + // TODO remove this suppression once "disable legacy session" code has been removed from Smack + @SuppressWarnings("deprecation") protected void bindResourceAndEstablishSession(String resource) throws XMPPErrorException, IOException, SmackException { 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 c0699c819..deca8b440 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/ConnectionConfiguration.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/ConnectionConfiguration.java @@ -258,7 +258,10 @@ public abstract class ConnectionConfiguration { * 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; } @@ -581,10 +584,18 @@ public abstract class ConnectionConfiguration { * 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();