aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDamian Minkov <damencho@jitsi.org>2006-09-25 10:11:33 +0000
committerDamian Minkov <damencho@jitsi.org>2006-09-25 10:11:33 +0000
commiteca9b08603d3af2cd8e1345069e5c1e206b136c3 (patch)
treee479ad6a8dc6e28a8cfe23896d458ce3ece1c7b8 /src
parentc53606d0a18ef65eb03b839d187f267982dae236 (diff)
downloadjitsi-eca9b08603d3af2cd8e1345069e5c1e206b136c3.zip
jitsi-eca9b08603d3af2cd8e1345069e5c1e206b136c3.tar.gz
jitsi-eca9b08603d3af2cd8e1345069e5c1e206b136c3.tar.bz2
When installing account check for SERVER_ADDRESS and SERVER_PORT if missing extract from userID and set default value.
Diffstat (limited to 'src')
-rw-r--r--src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderFactoryJabberImpl.java19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderFactoryJabberImpl.java b/src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderFactoryJabberImpl.java
index d37072d..b3cf263 100644
--- a/src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderFactoryJabberImpl.java
+++ b/src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderFactoryJabberImpl.java
@@ -8,6 +8,7 @@ package net.java.sip.communicator.impl.protocol.jabber;
import java.util.*;
+import org.jivesoftware.smack.util.*;
import org.osgi.framework.*;
import net.java.sip.communicator.service.protocol.*;
@@ -83,11 +84,25 @@ public class ProtocolProviderFactoryJabberImpl
if (userIDStr == null)
throw new NullPointerException("The specified AccountID was null");
- accountProperties.put(USER_ID, userIDStr);
-
if (accountProperties == null)
throw new NullPointerException("The specified property map was null");
+ accountProperties.put(USER_ID, userIDStr);
+
+ // if server address is null, we must extract it from userID
+ if(accountProperties.get(SERVER_ADDRESS) == null)
+ {
+ accountProperties.put(SERVER_ADDRESS,
+ StringUtils.parseServer(userIDStr));
+ }
+
+ // if server port is null, we will set default value
+ if(accountProperties.get(SERVER_PORT) == null)
+ {
+ accountProperties.put(SERVER_PORT,
+ "5222");
+ }
+
AccountID accountID = new JabberAccountID(userIDStr, accountProperties);
//make sure we haven't seen this account id before.