mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 02:20:39 +00:00
Cleanup
This commit is contained in:
parent
93e2c58fcf
commit
a4e22539a3
2 changed files with 6 additions and 4 deletions
|
@ -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() {
|
||||||
|
|
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue