Browse Source

Merge pull request #3693 from annando/remote-self-finally

"remote self" now finally really works with addons
pull/3694/head
Tobias Diekershoff 4 years ago
committed by GitHub
parent
commit
d79fe20f61
  1. 10
      include/items.php
  2. 3
      include/poller.php

10
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;
}

3
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;

Loading…
Cancel
Save