Skip to content
This repository was archived by the owner on Jul 25, 2024. It is now read-only.

Commit 87b67de

Browse files
committed
Save realmName, serverUrl in asynLogin
1 parent 5bb82bb commit 87b67de

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

app/src/main/java/com/zulip/android/AsyncLogin.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,33 @@
55
import org.json.JSONException;
66
import org.json.JSONObject;
77

8+
import android.content.SharedPreferences;
89
import android.util.Log;
910
import android.widget.Toast;
1011

1112
class AsyncLogin extends ZulipAsyncPushTask {
1213
public static final String UNREGISTERED = "unregistered";
1314
public static final String DISABLED = "disabled";
14-
15+
boolean startedFromAddRealm;
16+
String realmName;
17+
String serverURL = "";
1518
LoginActivity context;
1619
boolean userDefinitelyInvalid = false;
1720

1821
public AsyncLogin(LoginActivity loginActivity, String username,
19-
String password) {
22+
String password, String server, boolean startedFromAddRealm, String realmName) {
2023
super(loginActivity.app);
24+
this.startedFromAddRealm = startedFromAddRealm;
2125
context = loginActivity;
22-
if (username.contains("@")) {
26+
if (username.contains("@") && !startedFromAddRealm) {
2327
// @-less usernames are used as indicating special cases, for
2428
// example in OAuth2 authentication
2529
this.app.setEmail(username);
2630
}
2731
this.setProperty("username", username);
2832
this.setProperty("password", password);
33+
this.serverURL = server;
34+
this.realmName = realmName;
2935
}
3036

3137
public final void execute() {

0 commit comments

Comments
 (0)