+ // load current friends if possible.
+ if (($contact['poco'] != "") AND ($contact['success_update'] > $contact['failure_update'])) {
+ $r = q("SELECT count(*) as total from glink
+ where `cid` = %d and updated > UTC_TIMESTAMP() - INTERVAL 1 DAY",
+ intval($contact['id'])
+ );
+ if (count($r))
+ if (!$r[0]['total'])
+ poco_load($contact['id'],$importer_uid,0,$contact['poco']);
+ }
+
+ // To-Do:
+ // - Check why we don't poll the Diaspora feed at the moment (some guid problem in the items?)
+ // - Check whether this is possible with Redmatrix
+ if ($contact["network"] == NETWORK_DIASPORA) {
+ if (poco_do_update($contact["created"], $contact["last-item"], $contact["failure_update"], $contact["success_update"])) {
+ $last_updated = poco_last_updated($contact["url"]);
+ $updated = datetime_convert();
+ if ($last_updated) {
+ q("UPDATE `contact` SET `last-item` = '%s', `last-update` = '%s', `success_update` = '%s' WHERE `id` = %d",
+ dbesc($last_updated),
+ dbesc($updated),
+ dbesc($updated),
+ intval($contact['id'])
+ );
+ } else {
+ q("UPDATE `contact` SET `last-update` = '%s', `failure_update` = '%s' WHERE `id` = %d",
+ dbesc($updated),
+ dbesc($updated),
+ intval($contact['id'])
+ );
+ }
+ }
+ return;
+ }
+