This commit is contained in:
AsamK 2016-10-31 20:52:32 +01:00
parent 93e2c58fcf
commit a4e22539a3
2 changed files with 6 additions and 4 deletions

View file

@ -26,8 +26,7 @@ public class JsonContactsStore {
} }
ContactInfo getContact(String number) { ContactInfo getContact(String number) {
ContactInfo c = contacts.get(number); return contacts.get(number);
return c;
} }
List<ContactInfo> getContacts() { List<ContactInfo> getContacts() {

View file

@ -1041,8 +1041,11 @@ class Manager implements Signal {
DeviceContactsInputStream s = new DeviceContactsInputStream(retrieveAttachmentAsStream(syncMessage.getContacts().get().asPointer())); DeviceContactsInputStream s = new DeviceContactsInputStream(retrieveAttachmentAsStream(syncMessage.getContacts().get().asPointer()));
DeviceContact c; DeviceContact c;
while ((c = s.read()) != null) { while ((c = s.read()) != null) {
ContactInfo contact = new ContactInfo(); ContactInfo contact = contactStore.getContact(c.getNumber());
contact.number = c.getNumber(); if (contact == null) {
contact = new ContactInfo();
contact.number = c.getNumber();
}
if (c.getName().isPresent()) { if (c.getName().isPresent()) {
contact.name = c.getName().get(); contact.name = c.getName().get();
} }