|
5 | 5 | import org.json.JSONException;
|
6 | 6 | import org.json.JSONObject;
|
7 | 7 |
|
| 8 | +import android.content.SharedPreferences; |
8 | 9 | import android.util.Log;
|
9 | 10 | import android.widget.Toast;
|
10 | 11 |
|
11 | 12 | class AsyncLogin extends ZulipAsyncPushTask {
|
12 | 13 | public static final String UNREGISTERED = "unregistered";
|
13 | 14 | public static final String DISABLED = "disabled";
|
14 |
| - |
| 15 | + boolean startedFromAddRealm; |
| 16 | + String realmName; |
| 17 | + String serverURL = ""; |
15 | 18 | LoginActivity context;
|
16 | 19 | boolean userDefinitelyInvalid = false;
|
17 | 20 |
|
18 | 21 | public AsyncLogin(LoginActivity loginActivity, String username,
|
19 |
| - String password) { |
| 22 | + String password, String server, boolean startedFromAddRealm, String realmName) { |
20 | 23 | super(loginActivity.app);
|
| 24 | + this.startedFromAddRealm = startedFromAddRealm; |
21 | 25 | context = loginActivity;
|
22 |
| - if (username.contains("@")) { |
| 26 | + if (username.contains("@") && !startedFromAddRealm) { |
23 | 27 | // @-less usernames are used as indicating special cases, for
|
24 | 28 | // example in OAuth2 authentication
|
25 | 29 | this.app.setEmail(username);
|
26 | 30 | }
|
27 | 31 | this.setProperty("username", username);
|
28 | 32 | this.setProperty("password", password);
|
| 33 | + this.serverURL = server; |
| 34 | + this.realmName = realmName; |
29 | 35 | }
|
30 | 36 |
|
31 | 37 | public final void execute() {
|
|
0 commit comments