}
catch (AppDotNetException $e) {
logger("appnet_fetchstream: Error fetching stream for user ".$uid." ".appnet_error($e->getMessage()));
+ return;
}
+ if (!is_array($stream))
+ $stream = array();
+
$stream = array_reverse($stream);
foreach ($stream AS $post) {
$postarray = appnet_createpost($a, $uid, $post, $me, $user, $ownid, true);
$item = item_store($postarray);
+ $postarray["id"] = $item;
+
logger('appnet_fetchstream: User '.$uid.' posted stream item '.$item);
$lastid = $post["id"];
}
catch (AppDotNetException $e) {
logger("appnet_fetchstream: Error fetching mentions for user ".$uid." ".appnet_error($e->getMessage()));
+ return;
}
+ if (!is_array($mentions))
+ $mentions = array();
+
$mentions = array_reverse($mentions);
foreach ($mentions AS $post) {
$postarray = appnet_createpost($a, $uid, $post, $me, $user, $ownid, false);
$parent_id = $postarray['parent'];
} elseif (isset($postarray["body"])) {
$item = item_store($postarray);
+ $postarray["id"] = $item;
+
$parent_id = 0;
logger('appnet_fetchstream: User '.$uid.' posted mention item '.$item);
} else {
foreach ($thread AS $tpost) {
$threadpost = appnet_createpost($a, $uid, $tpost, $me, $user, $ownid, false, false);
$item = item_store($threadpost);
+ $threadpost["id"] = $item;
+
logger("appnet_createpost: stored post ".$post["id"]." thread ".$post["thread_id"]." in item ".$item, LOGGER_DEBUG);
}
//}