Merge pull request #3683 from annando/remote-self-addon
"remote-self" hadn't worked well with addons
This commit is contained in:
commit
26a223c746
|
@ -939,6 +939,10 @@ function item_store($arr, $force_parent = false, $notify = false, $dontcache = f
|
||||||
call_hooks('post_remote', $arr);
|
call_hooks('post_remote', $arr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This array field is used to trigger some automatic reactions
|
||||||
|
// It is mainly used in the "post_local" hook.
|
||||||
|
unset($arr['api_source']);
|
||||||
|
|
||||||
if (x($arr, 'cancel')) {
|
if (x($arr, 'cancel')) {
|
||||||
logger('item_store: post cancelled by plugin.');
|
logger('item_store: post cancelled by plugin.');
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1591,6 +1595,9 @@ function item_is_remote_self($contact, &$datarray) {
|
||||||
$datarray['author-link'] = $datarray['owner-link'];
|
$datarray['author-link'] = $datarray['owner-link'];
|
||||||
$datarray['author-avatar'] = $datarray['owner-avatar'];
|
$datarray['author-avatar'] = $datarray['owner-avatar'];
|
||||||
|
|
||||||
|
// Trigger automatic reactions for addons
|
||||||
|
$datarray['api_source'] = true;
|
||||||
|
|
||||||
unset($datarray['created']);
|
unset($datarray['created']);
|
||||||
unset($datarray['edited']);
|
unset($datarray['edited']);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user