From 5abbfd3f19b6b77ea8d6dd418afcb84775716f21 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Mon, 29 Apr 2019 23:21:17 +0200 Subject: Add initial threaded comment support --- include/items.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'include/items.php') diff --git a/include/items.php b/include/items.php index c08deb3a0..7a5c2c3c3 100755 --- a/include/items.php +++ b/include/items.php @@ -1875,9 +1875,12 @@ function item_store($arr, $allow_exec = false, $deliver = true) { // is the new message multi-level threaded? // even though we don't support it now, preserve the info // and re-attach to the conversation parent. + + // @FIXME when we'll start threaded comments support, + // now this respected on mid / parent_mid level (MK) if($r[0]['mid'] != $r[0]['parent_mid']) { - $arr['parent_mid'] = $r[0]['parent_mid']; + //$arr['parent_mid'] = $r[0]['parent_mid']; $z = q("SELECT * FROM item WHERE mid = '%s' AND parent_mid = '%s' AND uid = %d ORDER BY id ASC LIMIT 1", dbesc($r[0]['parent_mid']), @@ -4278,7 +4281,7 @@ function items_fetch($arr,$channel = null,$observer_hash = null,$client_mode = C if($arr['mid']) $sql_options .= " and parent_mid = '" . dbesc($arr['mid']) . "' "; - $sql_extra = " AND item.parent IN ( SELECT parent FROM item WHERE item_thread_top = 1 $sql_options $item_normal ) "; + $sql_extra = " AND item.parent IN ( SELECT parent FROM item WHERE $item_uids and item_thread_top = 1 $sql_options $item_normal ) "; if($arr['since_id']) $sql_extra .= " and item.id > " . $since_id . " "; -- cgit v1.2.3