Example #1
0
 @Override
 public void updateContactList() throws ConnectionException {
   JsonObject obj =
       Endpoints.GET_ALL_CONTACTS
           .open(this, getUsername(), "notification")
           .as(JsonObject.class)
           .expect(200, "While loading contacts")
           .get();
   for (JsonValue value : obj.get("contacts").asArray()) {
     if (value.asObject().get("suggested") == null
         || !value.asObject().get("suggested").asBoolean()) {
       String id = value.asObject().get("id").asString();
       ContactImpl impl = (ContactImpl) allContacts.get(id);
       impl.update(value.asObject());
     }
   }
 }