self._progress("Finalising...", current_tick, total_ticks)
current_tick += len(contacts)
service.finalise(self.updated, overwrite_existing_fields)
- self.friends[service.get_id] = service.get_unmatched_friends()
+ for friend in service.get_unmatched_friends():
+ friend.set_source(service.get_id())
+ key = unicode(friend.get_name()).encode('trans') + "_" + service.get_id()
+ self.friends[key] = friend
# commit changes
tick_increment = total_contacts / (len(self.updated) or 1)
"""Update the given contact with information from the given friend."""
print "updating contact ", contact, " with friend ", friend
- self.updated.append(contact)
+ if friend.update_contact(contact, resync):
+ self.updated.append(contact)
+
self.matched.append(contact)
if friend.get_source() is not None:
contact.add_mapping(friend.get_source())