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
No related branches found
No related tags found
No related merge requests found
......@@ -50,11 +50,15 @@ public class ContactCodec implements Encoder, Decoder {
StringBuilder sb = new StringBuilder();
sb.append("{\"uri\":\"").append(ct.getUri()).append("\",");
switch (ct.getStatus()){
case 'A': sb.append("\"added\":").append(ct.getTimestamp()); break;
case 'D': sb.append("\"removed\":").append(ct.getTimestamp()); break;
case 'A':
sb.append("\"added\":").append(ct.getTimestamp());
sb.append(",");
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("\"banned\":").append(ct.getBanned()).append(",");
sb.append("\"confirmed\":").append(ct.getConfirmed());
sb.append("}");
jsonStream.write(sb.toString().getBytes());
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment