+ def _register_friend(self, friend):
+ self._friends_without_contact.add(friend)
+
+ for url in friend.get_urls():
+ if self.is_profile_url(url):
+ self._friends_by_url[url] = friend
+
+ if self._allow_friend_to_match_by_name(friend):
+ key = canonical(friend.get_name())
+ self._friends_by_name[key] = friend
+
+
+ # -----------------------------------------------------------------------
+ def is_profile_url(self, url):
+ """Return True if this is a URL for this service."""
+
+ return url and "facebook.com" in url
+
+
+ # -----------------------------------------------------------------------
+ def _allow_friend_to_match_by_name(self, friend):
+ for url in friend.get_urls():
+ if url in self._known_urls:
+ return False
+ return True
+
+
+ # -----------------------------------------------------------------------