return;
// if posts comes from statusnet don't send it back
+ if($b['extid'] == NETWORK_STATUSNET)
+ return;
+
if($b['app'] == "StatusNet")
return;
$_REQUEST["type"] = "wall";
$_REQUEST["api_source"] = true;
$_REQUEST["profile_uid"] = $uid;
- $_REQUEST["source"] = "StatusNet";
+ //$_REQUEST["source"] = "StatusNet";
+ $_REQUEST["source"] = $post->source;
+ $_REQUEST["extid"] = NETWORK_STATUSNET;
//$_REQUEST["date"] = $post->created_at;
}
function statusnet_fetch_contact($uid, $contact, $create_user) {
+ if ($contact->statusnet_profile_url == "")
+ return(-1);
+
// Check if the unique contact is existing
// To-Do: only update once a while
$r = q("SELECT id FROM unique_contacts WHERE url='%s' LIMIT 1",
q("UPDATE `contact` SET `photo` = '%s',
`thumb` = '%s',
`micro` = '%s',
- `name-date` = '%s',
- `uri-date` = '%s',
`avatar-date` = '%s'
WHERE `id` = %d",
dbesc($photos[0]),
dbesc($photos[1]),
dbesc($photos[2]),
dbesc(datetime_convert()),
- dbesc(datetime_convert()),
- dbesc(datetime_convert()),
intval($contact_id)
);
// check that we have all the photos, this has been known to fail on occasion
- if((! $r[0]['photo']) || (! $r[0]['thumb']) || (! $r[0]['micro']) || ($update_photo)) {
+ if((!$r[0]['photo']) || (!$r[0]['thumb']) || (!$r[0]['micro']) || ($update_photo)) {
logger("statusnet_fetch_contact: Updating contact ".$contact->screen_name, LOGGER_DEBUG);
$items = $connection->get('statuses/home_timeline', $parameters);
if (!is_array($items)) {
- logger("statusnet_fetchhometimeline: Error fetching home timeline: ".print_r($items, true), LOGGER_DEBUG);
+ if (is_object($items) AND isset($items->error))
+ $errormsg = $items->error;
+ elseif (is_object($items))
+ $errormsg = print_r($items, true);
+ elseif (is_string($items) OR is_float($items) OR is_int($items))
+ $errormsg = $items;
+ else
+ $errormsg = "Unknown error";
+
+ logger("statusnet_fetchhometimeline: Error fetching home timeline: ".$errormsg, LOGGER_DEBUG);
return;
}