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

Commit 04f3481

Browse files
committed
Login through add realm in AsyncLogin
1 parent db3699e commit 04f3481

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44
import org.json.JSONObject;
55

66
import android.app.Activity;
7+
import android.content.Intent;
78
import android.util.Log;
89
import android.widget.Toast;
910

1011
import com.zulip.android.activities.DevAuthActivity;
1112
import com.zulip.android.activities.LoginActivity;
13+
import com.zulip.android.activities.ZulipActivity;
1214
import com.zulip.android.util.ZLog;
1315
import com.zulip.android.ZulipApp;
1416

@@ -79,6 +81,20 @@ protected void onPostExecute(String result) {
7981
Log.wtf("login", "We shouldn't have gotten this far.");
8082
}
8183

84+
private void loginThroughAddRealm(JSONObject jsonObject) {
85+
try {
86+
Intent intent = new Intent(context, ZulipActivity.class);
87+
intent.putExtra("realmName", realmName);
88+
intent.putExtra("api_key", jsonObject.getString("api_key"));
89+
intent.putExtra("email", username);
90+
intent.putExtra("serverURL", serverURL);
91+
context.setResult(Activity.RESULT_OK, intent);
92+
context.finish();
93+
} catch (JSONException e) {
94+
ZLog.logException(e);
95+
}
96+
}
97+
8298
@Override
8399
protected void onCancelled(String result) {
84100
super.onCancelled(result);

0 commit comments

Comments
 (0)