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

Commit e16e8c7

Browse files
committed
Pass Server URL to HTTPRequest for logging in.
1 parent 16740c6 commit e16e8c7

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ public AsyncLogin(Activity loginActivity, String username, String password, Stri
4242
}
4343
this.setProperty("password", password);
4444
this.realmName = realmName;
45+
this.setServerURL(serverURL);
4546
this.serverURL = serverURL;
4647
}
4748

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,16 @@ public void setMethodAndUrl(String method, String URL) {
3838
this.path = URL;
3939
}
4040

41+
String serverURL = null;
4142
public HTTPRequest(ZulipApp app) {
4243
properties = new HashMap<>();
4344
this.app = app;
4445
okHttpClient = new OkHttpClient.Builder().readTimeout(60, TimeUnit.SECONDS).build();
46+
this.serverURL = app.getServerURI();
47+
}
48+
49+
public void setServerURL(String serverURL) {
50+
this.serverURL = serverURL;
4551
}
4652

4753

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ public abstract class ZulipAsyncPushTask extends AsyncTask<String, String, Strin
2323
private HTTPRequest request;
2424
AsyncTaskCompleteListener callback;
2525

26+
public void setServerURL(String serverURL) {
27+
request.setServerURL(serverURL);
28+
}
29+
2630
/**
2731
* Interface implemented by callbacks which are run at the end of a task.
2832
* <p/>

0 commit comments

Comments
 (0)