forked from friendica/friendica-addons
SN import from timeline, check if there are posting before the foreach loop
This commit is contained in:
parent
b8c4455d84
commit
8e6d1d8f8b
|
@ -808,6 +808,7 @@ function statusnet_fetchtimeline($a, $uid) {
|
||||||
$items = $connection->get('statuses/user_timeline', $parameters);
|
$items = $connection->get('statuses/user_timeline', $parameters);
|
||||||
$posts = array_reverse($items);
|
$posts = array_reverse($items);
|
||||||
|
|
||||||
|
if (count($posts)) {
|
||||||
foreach ($posts as $post) {
|
foreach ($posts as $post) {
|
||||||
if ($post->id > $lastid)
|
if ($post->id > $lastid)
|
||||||
$lastid = $post->id;
|
$lastid = $post->id;
|
||||||
|
@ -854,6 +855,7 @@ function statusnet_fetchtimeline($a, $uid) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
set_pconfig($uid, 'statusnet', 'lastid', $lastid);
|
set_pconfig($uid, 'statusnet', 'lastid', $lastid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue