Add a trim() to remove extra spaces in jid and host
authorDa Risk <darisk972@gmail.com>
Mon, 21 Mar 2011 21:54:08 +0100
changeset 884 b2c242da8a1e
parent 883 c0a2d2743f38
child 885 bfb4326524f8
Add a trim() to remove extra spaces in jid and host
src/com/beem/project/beem/BeemService.java
--- a/src/com/beem/project/beem/BeemService.java	Thu Mar 03 01:02:25 2011 +0100
+++ b/src/com/beem/project/beem/BeemService.java	Mon Mar 21 21:54:08 2011 +0100
@@ -133,7 +133,8 @@
      * Initialize the connection.
      */
     private void initConnectionConfig() {
-	SmackConfiguration.setPacketReplyTimeout(30000);
+	// TODO add an option for this ?
+//         SmackConfiguration.setPacketReplyTimeout(30000);
 	mUseProxy = mSettings.getBoolean(BeemApplication.PROXY_USE_KEY, false);
 	if (mUseProxy) {
 	    String stype = mSettings.getString(BeemApplication.PROXY_TYPE_KEY, "HTTP");
@@ -196,7 +197,7 @@
 	    registerReceiver(mOnOffReceiver, new IntentFilter(Intent.ACTION_SCREEN_OFF));
 	    registerReceiver(mOnOffReceiver, new IntentFilter(Intent.ACTION_SCREEN_ON));
 	}
-	String tmpJid = mSettings.getString(BeemApplication.ACCOUNT_USERNAME_KEY, "");
+	String tmpJid = mSettings.getString(BeemApplication.ACCOUNT_USERNAME_KEY, "").trim();
 	mLogin = StringUtils.parseName(tmpJid);
 	mPassword = mSettings.getString(BeemApplication.ACCOUNT_PASSWORD_KEY, "");
 	mPort = DEFAULT_XMPP_PORT;
@@ -204,7 +205,7 @@
 	mHost = mService;
 
 	if (mSettings.getBoolean("settings_key_specific_server", false)) {
-	    mHost = mSettings.getString("settings_key_xmpp_server", "");
+	    mHost = mSettings.getString("settings_key_xmpp_server", "").trim();
 	    if ("".equals(mHost))
 		mHost = mService;
 	    String tmpPort = mSettings.getString("settings_key_xmpp_port", "5222");