aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Item.php
diff options
context:
space:
mode:
authorMax Kostikov <max@kostikov.co>2019-04-29 23:26:20 +0200
committerMax Kostikov <max@kostikov.co>2019-04-29 23:26:20 +0200
commitd9be443e53e7a8ef624f5e997bfc544ac567ee4b (patch)
tree98a8c8fac82e901c81c5e6736fa9c3c6e8611b2a /Zotlabs/Module/Item.php
parent6db323b15e6e9b5429d8d786959fcd60af4a30b2 (diff)
downloadvolse-hubzilla-d9be443e53e7a8ef624f5e997bfc544ac567ee4b.tar.gz
volse-hubzilla-d9be443e53e7a8ef624f5e997bfc544ac567ee4b.tar.bz2
volse-hubzilla-d9be443e53e7a8ef624f5e997bfc544ac567ee4b.zip
Add initial threaded comments support
Diffstat (limited to 'Zotlabs/Module/Item.php')
-rw-r--r--Zotlabs/Module/Item.php16
1 files changed, 10 insertions, 6 deletions
diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php
index 6bc8c645f..11ce1d268 100644
--- a/Zotlabs/Module/Item.php
+++ b/Zotlabs/Module/Item.php
@@ -216,7 +216,7 @@ class Item extends Controller {
$parent = ((x($_REQUEST,'parent')) ? intval($_REQUEST['parent']) : 0);
$parent_mid = ((x($_REQUEST,'parent_mid')) ? trim($_REQUEST['parent_mid']) : '');
-
+
$remote_xchan = ((x($_REQUEST,'remote_xchan')) ? trim($_REQUEST['remote_xchan']) : false);
$r = q("select * from xchan where xchan_hash = '%s' limit 1",
dbesc($remote_xchan)
@@ -329,9 +329,14 @@ class Item extends Controller {
$obj_type = ACTIVITY_OBJ_COMMENT;
if($parent) {
- $r = q("SELECT * FROM item WHERE id = %d LIMIT 1",
+ // Get commented post data
+ $rr = q("SELECT parent, mid FROM item WHERE id = %d LIMIT 1",
intval($parent)
);
+ // and its parent
+ $r = q("SELECT * FROM item WHERE id = %d LIMIT 1",
+ intval($rr[0]['parent'])
+ );
}
elseif($parent_mid && $uid) {
// This is coming from an API source, and we are logged in
@@ -910,8 +915,7 @@ class Item extends Controller {
}
if($parent_item)
- $parent_mid = $parent_item['mid'];
-
+ $parent_mid = $rr[0]['mid'];
// Fallback so that we alway have a thr_parent
@@ -1014,7 +1018,7 @@ class Item extends Controller {
$datarray['term'] = $post_tags;
$datarray['plink'] = $plink;
$datarray['route'] = $route;
-
+
// A specific ACL over-rides public_policy completely
@@ -1160,7 +1164,7 @@ class Item extends Controller {
'verb' => ACTIVITY_POST,
'otype' => 'item',
'parent' => $parent,
- 'parent_mid' => $parent_item['mid']
+ 'parent_mid' => $rr[0]['mid']
));
}