aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2021-10-09 20:08:23 +0200
committerMario Vavti <mario@mariovavti.com>2021-10-09 20:08:23 +0200
commit094536e6339eaba87cc0b372418a50b865fe0a97 (patch)
tree71f8e1f1d421322dbe52ca631e6bd32bd05e8b43 /Zotlabs/Module
parent4f2a439873d105b91a5dbbd4dc72d2e2183349a8 (diff)
parent63bdab2b5fd456979587e3c065c274c6475c17b1 (diff)
downloadvolse-hubzilla-094536e6339eaba87cc0b372418a50b865fe0a97.tar.gz
volse-hubzilla-094536e6339eaba87cc0b372418a50b865fe0a97.tar.bz2
volse-hubzilla-094536e6339eaba87cc0b372418a50b865fe0a97.zip
Merge branch 'dev' of https://framagit.org/hubzilla/core into dev
Diffstat (limited to 'Zotlabs/Module')
-rw-r--r--Zotlabs/Module/Search.php24
1 files changed, 7 insertions, 17 deletions
diff --git a/Zotlabs/Module/Search.php b/Zotlabs/Module/Search.php
index 06a761998..5db0ce423 100644
--- a/Zotlabs/Module/Search.php
+++ b/Zotlabs/Module/Search.php
@@ -3,6 +3,7 @@
namespace Zotlabs\Module;
use App;
+use Zotlabs\Lib\Libzot;
use Zotlabs\Lib\Activity;
use Zotlabs\Lib\ActivityStreams;
use Zotlabs\Web\Controller;
@@ -57,26 +58,15 @@ class Search extends Controller {
$o .= search($search, 'search-box', '/search', ((local_channel()) ? true : false));
if (local_channel() && strpos($search, 'https://') === 0 && !$update && !$load) {
- $j = Activity::fetch(punify($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)) {
- $item = Activity::decode_note($AS);
- if ($item) {
- logger('parsed_item: ' . print_r($item, true), LOGGER_DATA);
- Activity::store(App::get_channel(), $observer_hash, $AS, $item, true, true);
- goaway(z_root() . '/display/' . gen_link_id($item['mid']));
- }
- }
- }
+ $f = Libzot::fetch_conversation(App::get_channel(), punify($search), true);
+
+ if ($f) {
+ goaway(z_root() . '/hq/' . gen_link_id($f['message_id']));
}
else {
- // try other fetch providers (e.g. diaspora)
+ // try other fetch providers (e.g. diaspora, pubcrawl)
$hookdata = [
- 'channel' => App::get_channel(),
- 'data' => $search
+ 'url' => punify($search)
];
call_hooks('fetch_provider', $hookdata);
}