diff --git a/Zotlabs/Module/Like.php b/Zotlabs/Module/Like.php index e704c397e..52c559a17 100644 --- a/Zotlabs/Module/Like.php +++ b/Zotlabs/Module/Like.php @@ -67,7 +67,7 @@ class Like extends Controller { $items = conv_sort($items, 'commented'); } else { - $item = item_by_item_id($arr['item']['id']); + $item = item_by_item_id($arr['item']['id'], $arr['item']['parent']); xchan_query($item, true); $item = fetch_post_tags($item, true); } diff --git a/include/items.php b/include/items.php index 05e220415..33b5f4b76 100644 --- a/include/items.php +++ b/include/items.php @@ -5360,87 +5360,43 @@ function set_activity_mid($string) { return str_replace(z_root() . '/item/', z_root() . '/activity/', $string); } -/** - * @brief returns SQL which counts activities for an item and - * if there is an observer also count activities authored by observer. - * @param string $prefix (optional) - */ - -function item_activity_sql($prefix = 'c') { - $sql = ''; - $observer = get_observer_hash(); - - $thread_allow = ((local_channel()) ? PConfig::Get(local_channel(), 'system', 'thread_allow', true) : Config::Get('system', 'thread_allow', true)); - - if ($observer) { - $sql = << $v) { @@ -5654,10 +5573,15 @@ function item_reaction_sql(string $ids, string $permission_sql = ''): array COALESCE(reaction_{$k}.observer_{$k}_count, 0) AS observer_{$k}_count SQL; + $join .= <<buffer($data['body']); if ($mime && array_key_exists($mime, $types)) {