reply collection issue using nomadic uri

This commit is contained in:
Mike Macgirvin 2024-07-10 17:03:27 +10:00
parent 51df69ecb7
commit a4f4ab2794

View file

@ -31,19 +31,12 @@ class Replies extends Controller
// do we have the item (at all)?
$test = q(
"select * from item where mid = '%s' $item_normal limit 1",
dbesc(z_root() . '/activity/' . $item_mid)
$test = q("select * from item where mid like '%s' $item_normal limit 1",
dbesc(z_root() . protect_sprintf('/%/') . $item_mid)
);
if (!$test) {
$test = q(
"select * from item where mid = '%s' $item_normal limit 1",
dbesc(z_root() . '/item/' . $item_mid)
);
if (!$test) {
http_status_exit(404, 'Not found');
}
http_status_exit(404, 'Not found');
}
// process an authenticated fetch
$zot6Hubloc = false;
@ -163,7 +156,7 @@ class Replies extends Controller
http_status_exit(403, 'Forbidden');
}
$collection = ZlibActivity::encode_item_collection($nitems, 'replies/' . $item_mid, 'OrderedCollection', true, z_root() . '/channel/' . $chan['channel_address'], count($nitems));
$collection = ZlibActivity::encode_item_collection($nitems, 'replies/' . $item_mid, 'OrderedCollection', true, Channel::getDidResolver($chan, true), count($nitems));
if ($portable_id && (!intval($items[0]['item_private']))) {
ThreadListener::store(z_root() . '/activity/' . $item_mid, $portable_id);
}