- if (count($r) == 0)
- q("INSERT INTO unique_contacts (url, name, nick, avatar) VALUES ('%s', '%s', '%s', '%s')",
- dbesc(normalise_link($contact->statusnet_profile_url)),
- dbesc($contact->name),
- dbesc($contact->screen_name),
- dbesc($contact->profile_image_url));
- else
- q("UPDATE unique_contacts SET name = '%s', nick = '%s', avatar = '%s' WHERE url = '%s'",
- dbesc($contact->name),
- dbesc($contact->screen_name),
- dbesc($contact->profile_image_url),
- dbesc(normalise_link($contact->statusnet_profile_url)));
+ update_gcontact(array("url" => $contact->statusnet_profile_url,
+ "network" => NETWORK_STATUSNET, "photo" => $contact->profile_image_url,
+ "name" => $contact->name, "nick" => $contact->screen_name,
+ "location" => $contact->location, "about" => $contact->description,
+ "addr" => statusnet_address($contact), "generation" => 3));