Fix updating of contacts, and change method name. Also, pull in
authorAndrew Flegg <andrew@bleb.org>
Wed, 9 Jun 2010 20:02:48 +0000 (21:02 +0100)
committerAndrew Flegg <andrew@bleb.org>
Wed, 9 Jun 2010 20:02:48 +0000 (21:02 +0100)
unmatched friends for manual mapping.

package/src/org/maemo/hermes/engine/friend.py
package/src/org/maemo/hermes/engine/hermes.py

index 2ca6b5d..a45a6bb 100644 (file)
@@ -73,7 +73,7 @@ class Friend():
     def set_photo_url(self, url):
         self._set('photo-url', url)
     
-    def update_friend(self, other_friend, overwrite=False):
+    def update_from_friend(self, other_friend, overwrite=False):
         """
         Overwrites any attributes in this friend, with attributes from other_friend
         """
index d33357f..2cbacd6 100644 (file)
@@ -77,10 +77,10 @@ class Hermes:
                 friend = service.process_contact(contact)
                 if friend:
                     contact.add_mapping(service.get_id())
-                    friend.update_friend(result)
+                    result.update_from_friend(friend)
             
             if result.get_name() is not None:
-                self.update_contact(result, overwrite_existing_fields)
+                self.update_contact(contact, result, overwrite_existing_fields)
             else:
                 self.unmatched.append(contact)
             
@@ -101,6 +101,7 @@ class Hermes:
             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()
             
         # commit changes
         tick_increment = total_contacts / (len(self.updated) or 1)