From 25424c16e41dc4773a7464129cac7a9acd4667dc Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 3 Feb 2022 19:09:15 +0000 Subject: unpack encoded mid and make sure to goaway to the right message --- Zotlabs/Module/Search.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Zotlabs/Module/Search.php b/Zotlabs/Module/Search.php index 5db0ce423..1df45233c 100644 --- a/Zotlabs/Module/Search.php +++ b/Zotlabs/Module/Search.php @@ -58,10 +58,22 @@ class Search extends Controller { $o .= search($search, 'search-box', '/search', ((local_channel()) ? true : false)); if (local_channel() && strpos($search, 'https://') === 0 && !$update && !$load) { + if (strpos($search, 'b64.') !== false) { + $search = unpack_link_id(basename($search)); + } + $f = Libzot::fetch_conversation(App::get_channel(), punify($search), true); if ($f) { - goaway(z_root() . '/hq/' . gen_link_id($f['message_id'])); + $mid = $f[0]['message_id']; + foreach ($f as $m) { + if (strpos($search, $m['message_id']) === 0) { + $mid = $m['message_id']; + break; + } + } + + goaway(z_root() . '/hq/' . gen_link_id($mid)); } else { // try other fetch providers (e.g. diaspora, pubcrawl) -- cgit v1.2.3