File tree Expand file tree Collapse file tree 1 file changed +26
-1
lines changed
helpstack/src/com/tenmiles/helpstack/gears Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -255,7 +255,10 @@ public void onResponse(JSONObject response) {
255
255
JSONObject updateObject = updateArray .getJSONObject (i );
256
256
257
257
if (!updateObject .isNull ("message" )) {
258
- ticketUpdates .add (parseTicketUpdateFromJson (updateObject ));
258
+ HSTicketUpdate update = parseTicketUpdateFromJson (updateObject );
259
+ if (update != null ) {
260
+ ticketUpdates .add (update );
261
+ }
259
262
}
260
263
}
261
264
@@ -313,6 +316,10 @@ public void onResponse(JSONObject response) {
313
316
314
317
update = parseTicketUpdateFromJson (updateObject );
315
318
319
+ if (update == null ) {
320
+ continue ;
321
+ }
322
+
316
323
break ;
317
324
}
318
325
@@ -384,10 +391,28 @@ private HSKBItem[] getSectionsFromData(JSONArray sectionsArray) {
384
391
return array ;
385
392
}
386
393
394
+
395
+ /**
396
+ *
397
+ * @param updateObject, can be null if it is private note
398
+ * @return
399
+ * @throws JSONException
400
+ */
387
401
private HSTicketUpdate parseTicketUpdateFromJson (JSONObject updateObject ) throws JSONException {
388
402
String updateId = null ;
389
403
String userName = null ;
390
404
405
+ if (updateObject .isNull ("message" )) {
406
+ return null ;
407
+ }
408
+
409
+ JSONObject messageObject = updateObject .getJSONObject ("message" );
410
+
411
+ // private note
412
+ if (!messageObject .isNull ("message_type" ) && messageObject .getString ("message_type" ).equals ("p" )) {
413
+ return null ;
414
+ }
415
+
391
416
JSONObject byObject = updateObject .getJSONObject ("by" );
392
417
if (!byObject .isNull ("name" )) {
393
418
userName = updateObject .getJSONObject ("by" ).getString ("name" );
You can’t perform that action at this time.
0 commit comments