diff options
author | Mario <mario@mariovavti.com> | 2021-01-31 20:37:16 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2021-01-31 20:37:16 +0000 |
commit | d99611e7dd1648e6a77d48aa612a840941545738 (patch) | |
tree | 8dbbdd18330e5628ddd80cefc226cdb694079b9c /Zotlabs/Module | |
parent | 7686b48723727a6be8d6f3c3ccd511da690d0014 (diff) | |
download | volse-hubzilla-d99611e7dd1648e6a77d48aa612a840941545738.tar.gz volse-hubzilla-d99611e7dd1648e6a77d48aa612a840941545738.tar.bz2 volse-hubzilla-d99611e7dd1648e6a77d48aa612a840941545738.zip |
add fetch_provider hook
Diffstat (limited to 'Zotlabs/Module')
-rw-r--r-- | Zotlabs/Module/Search.php | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/Zotlabs/Module/Search.php b/Zotlabs/Module/Search.php index 95510c349..eeeff9613 100644 --- a/Zotlabs/Module/Search.php +++ b/Zotlabs/Module/Search.php @@ -58,15 +58,13 @@ class Search extends Controller { $o .= search($search, 'search-box', '/search', ((local_channel()) ? true : false)); - if (local_channel() && strpos($search, 'https://') === 0) { + if (local_channel() && strpos($search, 'https://') === 0 && !$update && !$load) { $j = Activity::fetch($search, App::get_channel()); if ($j) { $AS = new ActivityStreams($j); - if ($AS->is_valid()) { // check if is_an_actor, otherwise import activity if (is_array($AS->obj) && !ActivityStreams::is_an_actor($AS->obj)) { - // The boolean flag enables html cache of the item $item = Activity::decode_note($AS); if ($item) { logger('parsed_item: ' . print_r($item, true), LOGGER_DATA); @@ -76,6 +74,14 @@ class Search extends Controller { } } } + else { + // try other fetch providers (e.g. diaspora) + $hookdata = [ + 'channel' => App::get_channel(), + 'data' => $search + ]; + call_hooks('fetch_provider', $hookdata); + } } if (strpos($search, '#') === 0) { @@ -120,7 +126,7 @@ class Search extends Controller { // Here is the way permissions work in the search module... // Only public posts can be shown // OR your own posts if you are a logged in member - // No items will be shown if the member has a blocked profile wall. + // No items will be shown if the member has a blocked profile wall. if ((!$update) && (!$load)) { |