Backward compatibility

pull/153/head
M66B 7 years ago
parent 94574480ac
commit 0960b28e02

@ -702,14 +702,16 @@ public class ActivitySetup extends ActivityBilling implements FragmentManager.On
} }
// Contacts // Contacts
JSONArray jcontacts = jaccount.getJSONArray("contacts"); if (jaccount.has("contacts")) {
for (int c = 0; c < jcontacts.length(); c++) { JSONArray jcontacts = jaccount.getJSONArray("contacts");
JSONObject jcontact = (JSONObject) jcontacts.get(c); for (int c = 0; c < jcontacts.length(); c++) {
EntityContact contact = EntityContact.fromJSON(jcontact); JSONObject jcontact = (JSONObject) jcontacts.get(c);
contact.account = account.id; EntityContact contact = EntityContact.fromJSON(jcontact);
if (db.contact().getContact(contact.account, contact.type, contact.email) == null) { contact.account = account.id;
contact.id = db.contact().insertContact(contact); if (db.contact().getContact(contact.account, contact.type, contact.email) == null) {
Log.i("Imported contact=" + contact); contact.id = db.contact().insertContact(contact);
Log.i("Imported contact=" + contact);
}
} }
} }

Loading…
Cancel
Save