Spark 1740 smack3 compat (#199)

* SPARK-1735: MUC occupants list should have width

This commit attempts to prevent that the occupants list in a MUC
screen has a near-zero width.

* SPARK-1772: Icons for muc role fix

* SPARK-1735: MUC occupants list should have vertical scrollbar

* SPARK-1740: Allow SASL GSS-API to be executed as it was in SMACK 3

SMACK 4 uses the fully qualified host name, when negotiating GSS-API
via SASL. SMACK 3 used the XMPP domain name instead. Spark should
have a configurable option that allows it to fall back to the old
mechanism (which is likely needed to connect to servers that
have already been configured to accept SSO from older versions of
Spark).

This commit also brings a reorganization of the code of the
'advanced connection settings' dialog - simply because it was pretty
unpractical as it was. Small modifications have been made to the
layout.
This commit is contained in:
Guus der Kinderen
2016-08-21 17:45:58 +02:00
committed by wroot
parent 5fad653e7e
commit e9582dd74e
11 changed files with 1408 additions and 1326 deletions

View File

@ -40,6 +40,9 @@ import org.jivesoftware.spark.SessionManager;
import org.jivesoftware.spark.SparkManager;
import org.jivesoftware.spark.Workspace;
import org.jivesoftware.spark.component.RolloverButton;
import org.jivesoftware.spark.sasl.SASLGSSAPIv3CompatMechanism;
import org.jivesoftware.spark.ui.login.GSSAPIConfiguration;
import org.jivesoftware.spark.ui.login.LoginSettingDialog;
import org.jivesoftware.spark.util.*;
import org.jivesoftware.spark.util.SwingWorker;
import org.jivesoftware.spark.util.log.Log;
@ -293,14 +296,23 @@ public class LoginDialog {
}
}
// SPARK-1747: Don't use the GSSAPI mechanism when SSO is disabled.
if ( localPref.isSSOEnabled() && !SASLAuthentication.getRegisterdSASLMechanisms().containsKey( SASLGSSAPIMechanism.class.getName() ))
// SPARK-1747: Don't use the GSS-API SASL mechanism when SSO is disabled.
SASLAuthentication.unregisterSASLMechanism( SASLGSSAPIMechanism.class.getName() );
SASLAuthentication.unregisterSASLMechanism( SASLGSSAPIv3CompatMechanism.class.getName() );
// Add the mechanism only when SSO is enabled (which allows us to register the correct one).
if ( localPref.isSSOEnabled() )
{
SASLAuthentication.registerSASLMechanism( new SASLGSSAPIMechanism() );
}
else if ( !localPref.isSSOEnabled() && SASLAuthentication.getRegisterdSASLMechanisms().containsValue( SASLGSSAPIMechanism.NAME ))
{
SASLAuthentication.unregisterSASLMechanism( SASLGSSAPIMechanism.class.getName() );
// SPARK-1740: Register a mechanism that's compatible with Smack 3, when requested.
if ( localPref.isSaslGssapiSmack3Compatible() )
{
// SPARK-1747: Don't use the GSSAPI mechanism when SSO is disabled.
SASLAuthentication.registerSASLMechanism( new SASLGSSAPIv3CompatMechanism() );
}
else
{
SASLAuthentication.registerSASLMechanism( new SASLGSSAPIMechanism() );
}
}
ReconnectionManager.setEnabledPerDefault( true );