mirror of
https://github.com/friendica/friendica
synced 2025-04-24 11:50:10 +00:00
Merge pull request #11025 from MrPetovan/task/11022-improve-connector-hooks
Improve connector hooks
This commit is contained in:
commit
a5ab184fb8
3 changed files with 28 additions and 46 deletions
|
@ -3262,6 +3262,18 @@ class Item
|
|||
return $item_id;
|
||||
}
|
||||
|
||||
$hookData = [
|
||||
'uri' => $uri,
|
||||
'uid' => $uid,
|
||||
'item_id' => null,
|
||||
];
|
||||
|
||||
Hook::callAll('item_by_link', $hookData);
|
||||
|
||||
if (isset($hookData['item_id'])) {
|
||||
return is_numeric($hookData['item_id']) ? $hookData['item_id'] : 0;
|
||||
}
|
||||
|
||||
if ($fetched_uri = ActivityPub\Processor::fetchMissingActivity($uri)) {
|
||||
$item_id = self::searchByLink($fetched_uri, $uid);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue