diff --git a/include/items.php b/include/items.php index eb9f44c3eb..ec4c986a18 100644 --- a/include/items.php +++ b/include/items.php @@ -1595,9 +1595,6 @@ function item_is_remote_self($contact, &$datarray) { $datarray['author-link'] = $datarray['owner-link']; $datarray['author-avatar'] = $datarray['owner-avatar']; - // Trigger automatic reactions for addons - $datarray['api_source'] = true; - unset($datarray['created']); unset($datarray['edited']); } @@ -1623,6 +1620,13 @@ function item_is_remote_self($contact, &$datarray) { $datarray["app"] = "Feed"; } + // Trigger automatic reactions for addons + $datarray['api_source'] = true; + + // We have to tell the hooks who we are - this really should be improved + $_SESSION["authenticated"] = true; + $_SESSION["uid"] = $contact['uid']; + return true; } diff --git a/include/poller.php b/include/poller.php index 9758ab9464..d43257fc9f 100644 --- a/include/poller.php +++ b/include/poller.php @@ -303,6 +303,9 @@ function poller_exec_function($queue, $funcname, $argv) { $up_duration = number_format(microtime(true) - $poller_up_start, 3); + // Reset global data to avoid interferences + unset($_SESSION); + $funcname($argv, $argc); $a->process_id = $old_process_id;