diff --git a/src/net/java/sip/communicator/plugin/sipaccregwizz/SIPAccountRegistration.java b/src/net/java/sip/communicator/plugin/sipaccregwizz/SIPAccountRegistration.java index 7536225e2..37a87e3b0 100755 --- a/src/net/java/sip/communicator/plugin/sipaccregwizz/SIPAccountRegistration.java +++ b/src/net/java/sip/communicator/plugin/sipaccregwizz/SIPAccountRegistration.java @@ -38,9 +38,9 @@ public class SIPAccountRegistration private String authorizationName; - private String serverPort = DEFAULT_PORT; + private String serverPort = null; - private String proxyPort = DEFAULT_PORT; + private String proxyPort = null; private String proxy; @@ -93,7 +93,10 @@ public String getProxy() public void setProxy(String proxy) { - this.proxy = proxy; + if(proxy != null && proxy.length() == 0) + this.proxy = null; + else + this.proxy = proxy; } /** @@ -214,7 +217,10 @@ public void setUserID(String id) */ public void setServerAddress(String serverAddress) { - this.serverAddress = serverAddress; + if(serverAddress != null && serverAddress.length() == 0) + this.serverAddress = null; + else + this.serverAddress = serverAddress; } /** @@ -224,7 +230,10 @@ public void setServerAddress(String serverAddress) */ public void setServerPort(String port) { - this.serverPort = port; + if(port != null && port.length() == 0) + this.serverPort = null; + else + this.serverPort = port; } /** @@ -234,7 +243,10 @@ public void setServerPort(String port) */ public void setDisplayName(String displayName) { - this.displayName = displayName; + if(displayName != null && displayName.length() == 0) + this.displayName = null; + else + this.displayName = displayName; } /** @@ -244,7 +256,10 @@ public void setDisplayName(String displayName) */ public void setAuthorizationName(String authName) { - this.authorizationName = authName; + if(authName != null && authName.length() == 0) + this.authorizationName = null; + else + this.authorizationName = authName; } /** @@ -254,7 +269,10 @@ public void setAuthorizationName(String authName) */ public void setProxyPort(String port) { - this.proxyPort = port; + if(port != null && port.length() == 0) + this.proxyPort = null; + else + this.proxyPort = port; } /** diff --git a/src/net/java/sip/communicator/plugin/sipaccregwizz/SIPAccountRegistrationWizard.java b/src/net/java/sip/communicator/plugin/sipaccregwizz/SIPAccountRegistrationWizard.java index 665bfe901..578efb191 100644 --- a/src/net/java/sip/communicator/plugin/sipaccregwizz/SIPAccountRegistrationWizard.java +++ b/src/net/java/sip/communicator/plugin/sipaccregwizz/SIPAccountRegistrationWizard.java @@ -329,8 +329,8 @@ private ProtocolProviderService installAccount( String passwd) throws OperationFailedException { - Hashtable accountProperties - = new Hashtable(); + HashMap accountProperties + = new HashMap(); accountProperties.put(ProtocolProviderFactory.PROTOCOL, getProtocol()); String protocolIconPath = getProtocolIconPath(); @@ -382,31 +382,20 @@ else if(serverAddress == null && Boolean.toString(true)); } - if(registration.getDisplayName() != null) - accountProperties.put(ProtocolProviderFactory.DISPLAY_NAME, - registration.getDisplayName()); + accountProperties.put(ProtocolProviderFactory.DISPLAY_NAME, + registration.getDisplayName()); - if(registration.getAuthorizationName() != null) - accountProperties.put(ProtocolProviderFactory.AUTHORIZATION_NAME, - registration.getAuthorizationName()); + accountProperties.put(ProtocolProviderFactory.AUTHORIZATION_NAME, + registration.getAuthorizationName()); - String serverPort = registration.getServerPort(); - if(serverPort != null && serverPort.length() > 0) - accountProperties.put(ProtocolProviderFactory.SERVER_PORT, - serverPort); + accountProperties.put(ProtocolProviderFactory.SERVER_PORT, + registration.getServerPort()); - String proxyAddress = null; - if (registration.getProxy() != null) - proxyAddress = registration.getProxy(); + accountProperties.put(ProtocolProviderFactory.PROXY_ADDRESS, + registration.getProxy()); - if (proxyAddress != null && proxyAddress.length() > 0) - accountProperties.put(ProtocolProviderFactory.PROXY_ADDRESS, - proxyAddress); - - String proxyPort = registration.getProxyPort(); - if(proxyPort != null && proxyPort.length() > 0) - accountProperties.put(ProtocolProviderFactory.PROXY_PORT, - proxyPort); + accountProperties.put(ProtocolProviderFactory.PROXY_PORT, + registration.getProxyPort()); accountProperties.put(ProtocolProviderFactory.PREFERRED_TRANSPORT, registration.getPreferredTransport()); @@ -442,6 +431,9 @@ else if(serverAddress == null && if(registration.getKeepAliveMethod() != null) accountProperties.put("KEEP_ALIVE_METHOD", registration.getKeepAliveMethod()); + else + accountProperties.put("KEEP_ALIVE_METHOD", + registration.getDefaultKeepAliveMethod()); accountProperties.put("KEEP_ALIVE_INTERVAL", registration.getKeepAliveInterval()); diff --git a/src/net/java/sip/communicator/service/protocol/AccountID.java b/src/net/java/sip/communicator/service/protocol/AccountID.java index d97bdcf00..90bb44989 100644 --- a/src/net/java/sip/communicator/service/protocol/AccountID.java +++ b/src/net/java/sip/communicator/service/protocol/AccountID.java @@ -133,7 +133,7 @@ protected AccountID( String userID, this.protocolName = protocolName; this.userID = userID; this.accountProperties - = new Hashtable(accountProperties); + = new HashMap(accountProperties); this.serviceName = serviceName; //create a unique identifier string @@ -211,7 +211,7 @@ public String getAccountUniqueID() */ public Map getAccountProperties() { - return new Hashtable(accountProperties); + return new HashMap(accountProperties); } public Object getAccountProperty(Object key)