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

Commit b0f37f5

Browse files
koziodigitalincniftynei
authored andcommitted
Updated based on comments
1 parent 6126271 commit b0f37f5

File tree

11 files changed

+28
-22
lines changed

11 files changed

+28
-22
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ public UserConfigurationResponse read(JsonReader in) throws IOException {
267267
currentPerson.setId(foundPerson.getId());
268268
}
269269
} catch (SQLException e) {
270-
e.printStackTrace();
270+
ZLog.logException(e);
271271
}
272272
}
273273

@@ -412,7 +412,7 @@ public <C, T> RuntimeExceptionDao<C, T> getDao(Class<C> cls, boolean useCache) {
412412
RuntimeExceptionDao<C, T> ret = new RuntimeExceptionDao<>(
413413
(Dao<C, T>) databaseHelper.getDao(cls));
414414
if(useCache) {
415-
ret.setObjectCache(objectCache);
415+
ret.setObjectCache(getObjectCache());
416416
}
417417
return ret;
418418
} catch (SQLException e) {

app/src/main/java/com/zulip/android/activities/DevAuthActivity.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ public void onItemClick(String email) {
6969
.enqueue(new DefaultCallback<LoginResponse>() {
7070
@Override
7171
public void onSuccess(Call<LoginResponse> call, Response<LoginResponse> response) {
72-
super.onSuccess(call, response);
7372
getApp().setLoggedInApiKey(response.body().getApiKey());
7473
openHome();
7574
}

app/src/main/java/com/zulip/android/activities/LoginActivity.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@ private void showBackends(String httpScheme, String serverURL) {
194194
mServerEditText.setText(serverUri.toString());
195195
mServerEditText.setEnabled(false);
196196
((ZulipApp) getApplication()).setServerURL(serverUri.toString());
197-
// AsyncGetBackends asyncGetBackends = new AsyncGetBackends(ZulipApp.get());
198197

199198
getServices()
200199
.getAuthBackends()

app/src/main/java/com/zulip/android/models/Message.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import com.j256.ormlite.misc.TransactionManager;
1919
import com.j256.ormlite.stmt.DeleteBuilder;
2020
import com.j256.ormlite.table.DatabaseTable;
21+
import com.zulip.android.R;
2122
import com.zulip.android.ZulipApp;
2223
import com.zulip.android.util.CustomHtmlToSpannedConverter;
2324
import com.zulip.android.util.ZLog;
@@ -168,10 +169,6 @@ public Message(ZulipApp app, JSONObject message,
168169
Map<String, Person> personCache,
169170
Map<String, Stream> streamCache) throws JSONException {
170171
this.setID(message.getInt("id"));
171-
// this.setSender(Person.getOrUpdate(app,
172-
// message.getString("sender_email"),
173-
// message.getString("sender_full_name"),
174-
// message.getString("avatar_url"), personCache));
175172

176173
if (message.getString("type").equals("stream")) {
177174
this.setType(MessageType.STREAM_MESSAGE);
@@ -314,7 +311,7 @@ public void setRecipients(Person[] list) {
314311
setRecipients(to.getId() + "," + from.getId());
315312
return;
316313
} catch (Exception e) {
317-
e.printStackTrace();
314+
ZLog.logException(e);
318315
}
319316

320317
this.recipients = (recipientId == 0 && senderId == 0) ? recipientList(list) : recipientId + "," + senderId;
@@ -581,7 +578,7 @@ public void setSubject(String subject) {
581578
if (subject != null && subject.equals("")) {
582579
// The empty string should be interpreted as "no topic"
583580
// i18n here will be sad
584-
this.subject = "(no topic)";
581+
this.subject = ZulipApp.get().getString(R.string.no_topic_in_message);
585582
} else {
586583
this.subject = subject;
587584
}

app/src/main/java/com/zulip/android/models/Person.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import com.j256.ormlite.stmt.SelectArg;
88
import com.j256.ormlite.table.DatabaseTable;
99
import com.zulip.android.ZulipApp;
10+
import com.zulip.android.util.ZLog;
1011

1112
import org.apache.commons.lang.builder.HashCodeBuilder;
1213

@@ -155,7 +156,7 @@ public static Person getByEmail(ZulipApp app, String email) {
155156
return getByEmail(app.getDatabaseHelper().getDao(
156157
Person.class), email);
157158
} catch (SQLException e) {
158-
e.printStackTrace();
159+
ZLog.logException(e);
159160
}
160161
return null;
161162
}
Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
package com.zulip.android.models.updated;
22

33

4+
import com.google.gson.annotations.SerializedName;
5+
46
public class JenkinsType {
5-
private String source_url;
6-
private String display_url;
77

8-
public String getSource_url() {
9-
return source_url;
8+
@SerializedName("sourceUrl")
9+
private String sourceUrl;
10+
11+
@SerializedName("displayUrl")
12+
private String displayUrl;
13+
14+
public String getSourceUrl() {
15+
return sourceUrl;
1016
}
1117

12-
public String getDisplay_url() {
13-
return display_url;
18+
public String getDisplayUrl() {
19+
return displayUrl;
1420
}
1521
}

app/src/main/java/com/zulip/android/networking/response/UserConfigurationResponse.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,14 @@ public class UserConfigurationResponse {
7979
@SerializedName("left_side_userlist")
8080
private boolean leftSideUserlist;
8181

82-
//todo
8382
@SerializedName("muted_topics")
8483
private List<List<String>> mutedTopics;
8584

86-
//todo
85+
//todo unkown type
8786
@SerializedName("alert_words")
8887
private List<?> alertWords;
8988

90-
//todo
89+
//todo unknown type
9190
@SerializedName("realm_bots")
9291
private List<?> realmBots;
9392

app/src/main/java/com/zulip/android/networking/response/events/GetEventResponse.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import com.google.gson.annotations.SerializedName;
66
import com.zulip.android.util.TypeSwapper;
7+
import com.zulip.android.util.ZLog;
78

89
import java.util.ArrayList;
910
import java.util.List;
@@ -50,6 +51,7 @@ public <T extends EventsBranch, R>List<R> getEventsOf(EventsBranch.BranchType br
5051
}
5152
catch(Exception e) {
5253
//catch misuse
54+
ZLog.logException(e);
5355
return null;
5456
}
5557
}

app/src/main/java/com/zulip/android/networking/util/DefaultCallback.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
package com.zulip.android.networking.util;
22

33
import android.support.annotation.CallSuper;
4-
import android.util.Log;
4+
5+
import com.zulip.android.util.ZLog;
56

67
import retrofit2.Call;
78
import retrofit2.Callback;
@@ -28,6 +29,6 @@ public void onSuccess(Call<T> call, Response<T> response) {
2829
@Override
2930
public void onFailure(Call<T> call, Throwable t) {
3031
//log error
31-
Log.e("DefaultCallback", "Nework failure", t);
32+
ZLog.logException(t);
3233
}
3334
}

app/src/main/res/values/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,5 @@
8484
<string name="no_login_error_widget">First login to Zulip app.</string>
8585
<string name="toast_login_failed_fetching_backends">Failed to fetch Backends!</string>
8686
<string name="login_activity_toast_login_error">Unknown login error.</string>
87+
<string name="no_topic_in_message">(no topic)</string>
8788
</resources>

0 commit comments

Comments
 (0)