From 3c6d83acd92e9058f54d61e991369de5e0ed3801 Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 8 Sep 2017 07:00:38 +0000 Subject: [PATCH 1/3] Remote self should now finally trigger all addons --- include/items.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/items.php b/include/items.php index eb9f44c3eb..df13202710 100644 --- a/include/items.php +++ b/include/items.php @@ -1598,6 +1598,10 @@ function item_is_remote_self($contact, &$datarray) { // 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']; + unset($datarray['created']); unset($datarray['edited']); } From a5a4f5328761962e3e537f61da36cdcb49983bc3 Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 8 Sep 2017 07:08:06 +0000 Subject: [PATCH 2/3] This is a better place --- include/items.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/include/items.php b/include/items.php index df13202710..ec4c986a18 100644 --- a/include/items.php +++ b/include/items.php @@ -1595,13 +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; - - // We have to tell the hooks who we are - this really should be improved - $_SESSION["authenticated"] = true; - $_SESSION["uid"] = $contact['uid']; - unset($datarray['created']); unset($datarray['edited']); } @@ -1627,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; } From c44448dd57683b29c3200d87d6274bf5dbe326e7 Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 8 Sep 2017 08:50:08 +0000 Subject: [PATCH 3/3] We should reset the session variable --- include/poller.php | 3 +++ 1 file changed, 3 insertions(+) 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;