aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMax Kostikov <max@kostikov.co>2019-04-29 23:21:17 +0200
committerMax Kostikov <max@kostikov.co>2019-04-29 23:21:17 +0200
commit5abbfd3f19b6b77ea8d6dd418afcb84775716f21 (patch)
treeba03bac7bdae4b2da95df1308e5d55a2f5bea3df /include
parenteb44201c5f9cc80aca3c4704cc35b9d5fb766b71 (diff)
downloadvolse-hubzilla-5abbfd3f19b6b77ea8d6dd418afcb84775716f21.tar.gz
volse-hubzilla-5abbfd3f19b6b77ea8d6dd418afcb84775716f21.tar.bz2
volse-hubzilla-5abbfd3f19b6b77ea8d6dd418afcb84775716f21.zip
Add initial threaded comment support
Diffstat (limited to 'include')
-rwxr-xr-xinclude/items.php7
1 files changed, 5 insertions, 2 deletions
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 . " ";