mirror of
https://github.com/friendica/friendica
synced 2025-04-26 18:30:11 +00:00
Fix for sending content via connectors
This commit is contained in:
parent
9c27de3f6d
commit
dd16bccbc8
2 changed files with 21 additions and 7 deletions
|
@ -932,7 +932,25 @@ class Item
|
|||
if ($notify) {
|
||||
$item['edit'] = false;
|
||||
$item['parent'] = $parent_id;
|
||||
|
||||
// Trigger automatic reactions for addons
|
||||
$item['api_source'] = true;
|
||||
|
||||
// We have to tell the hooks who we are - this really should be improved
|
||||
if (!local_user()) {
|
||||
$_SESSION['authenticated'] = true;
|
||||
$_SESSION['uid'] = $uid;
|
||||
$dummy_session = true;
|
||||
} else {
|
||||
$dummy_session = false;
|
||||
}
|
||||
|
||||
Hook::callAll('post_local', $item);
|
||||
|
||||
if ($dummy_session) {
|
||||
unset($_SESSION['authenticated']);
|
||||
unset($_SESSION['uid']);
|
||||
}
|
||||
} else {
|
||||
Hook::callAll('post_remote', $item);
|
||||
}
|
||||
|
@ -1971,13 +1989,6 @@ class Item
|
|||
$result = true;
|
||||
}
|
||||
|
||||
// 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 (bool)$result;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue