aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Search.php
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs/Module/Search.php')
-rw-r--r--Zotlabs/Module/Search.php19
1 files changed, 18 insertions, 1 deletions
diff --git a/Zotlabs/Module/Search.php b/Zotlabs/Module/Search.php
index 5db0ce423..fdc251b07 100644
--- a/Zotlabs/Module/Search.php
+++ b/Zotlabs/Module/Search.php
@@ -7,6 +7,7 @@ use Zotlabs\Lib\Libzot;
use Zotlabs\Lib\Activity;
use Zotlabs\Lib\ActivityStreams;
use Zotlabs\Web\Controller;
+use Zotlabs\Lib\Zotfinger;
class Search extends Controller {
@@ -58,10 +59,26 @@ 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) {
+ if (strpos($search, '?') !== false) {
+ $search = strtok($search, '?');
+ }
+
+ $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)