# HG changeset patch # User Da Risk # Date 1270064703 -7200 # Node ID a6e9d50ff96b8b3992c2e7fc3ee07bbfd042da36 # Parent f75ebc6738b9f03fc77606e7b230c078960a581d Fix the account wizard so that it realy checks a JID for username. diff -r f75ebc6738b9 -r a6e9d50ff96b src/com/beem/project/beem/BeemService.java --- a/src/com/beem/project/beem/BeemService.java Thu Mar 18 03:02:08 2010 +0100 +++ b/src/com/beem/project/beem/BeemService.java Wed Mar 31 21:45:03 2010 +0200 @@ -191,9 +191,6 @@ mService = StringUtils.parseServer(tmpJid); mHost = mService; - if ("".equals(mLogin)) - mLogin = mService; - if (mSettings.getBoolean("settings_key_specific_server", false)) { mHost = mSettings.getString("settings_key_xmpp_server", ""); if ("".equals(mHost)) diff -r f75ebc6738b9 -r a6e9d50ff96b src/com/beem/project/beem/ui/wizard/AccountConfigure.java --- a/src/com/beem/project/beem/ui/wizard/AccountConfigure.java Thu Mar 18 03:02:08 2010 +0100 +++ b/src/com/beem/project/beem/ui/wizard/AccountConfigure.java Wed Mar 31 21:45:03 2010 +0200 @@ -47,15 +47,16 @@ import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; -import android.view.View; -import android.view.View.OnClickListener; import android.preference.PreferenceManager; -import android.widget.Button; -import android.widget.EditText; import android.text.Editable; import android.text.InputFilter; import android.text.LoginFilter; +import android.text.TextUtils; import android.text.TextWatcher; +import android.view.View; +import android.view.View.OnClickListener; +import android.widget.Button; +import android.widget.EditText; import org.jivesoftware.smack.util.StringUtils; @@ -152,12 +153,13 @@ } /** - * check username. - * @param username . + * Check that the username is really a JID. + * @param username */ private void checkUsername(String username) { - String server = StringUtils.parseServer(username.toString()); - if (server == null || "".equals(server)) { + String name = StringUtils.parseName(username); + String server = StringUtils.parseServer(username); + if (TextUtils.isEmpty(name) || TextUtils.isEmpty(server)) { mValidJid = false; } else { mValidJid = true; @@ -165,7 +167,7 @@ } /** - * check password. + * Check password. * @param password . */ private void checkPassword(String password) {