Skip to content
Snippets Groups Projects
Commit c9d533ba authored by Félix  Sidokhine's avatar Félix Sidokhine
Browse files

fixed incorrect json logic

Change-Id: Id5ec575d44d0e331906321337dafd482a793a36e
parent 024beb24
Branches
Tags
No related merge requests found
...@@ -50,11 +50,15 @@ public class ContactCodec implements Encoder, Decoder { ...@@ -50,11 +50,15 @@ public class ContactCodec implements Encoder, Decoder {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append("{\"uri\":\"").append(ct.getUri()).append("\","); sb.append("{\"uri\":\"").append(ct.getUri()).append("\",");
switch (ct.getStatus()){ switch (ct.getStatus()){
case 'A': sb.append("\"added\":").append(ct.getTimestamp()); break; case 'A':
case 'D': sb.append("\"removed\":").append(ct.getTimestamp()); break; sb.append("\"added\":").append(ct.getTimestamp());
} sb.append(",");
sb.append("\"banned\":").append(ct.getBanned()).append(",");
sb.append("\"confirmed\":").append(ct.getConfirmed()); sb.append("\"confirmed\":").append(ct.getConfirmed());
break;
case 'D': sb.append("\"removed\":").append(ct.getTimestamp());
if(ct.getBanned()) sb.append(",").append("\"banned\":").append(ct.getBanned());
break;
}
sb.append("}"); sb.append("}");
jsonStream.write(sb.toString().getBytes()); jsonStream.write(sb.toString().getBytes());
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment