diff options
author | Max Kostikov <max@kostikov.co> | 2019-05-01 16:10:40 +0200 |
---|---|---|
committer | Max Kostikov <max@kostikov.co> | 2019-05-01 16:10:40 +0200 |
commit | 92b6026695b8f33d18a467bed7cb5f881ad65e21 (patch) | |
tree | 1166e7cb3bbaa9b5ef859510ca8a8012a9a646a6 | |
parent | c9a5f21344f985f5b4ee53ff349a9ac47116a778 (diff) | |
parent | 0174bf372297f353b5934ff6c42b4dac44c913bd (diff) | |
download | volse-hubzilla-92b6026695b8f33d18a467bed7cb5f881ad65e21.tar.gz volse-hubzilla-92b6026695b8f33d18a467bed7cb5f881ad65e21.tar.bz2 volse-hubzilla-92b6026695b8f33d18a467bed7cb5f881ad65e21.zip |
Merge branch 'dev' into 'dev'
Use thr_parent tp handle reply on comment feature
See merge request hubzilla/core!1617
-rw-r--r-- | Zotlabs/Module/Display.php | 2 | ||||
-rw-r--r-- | Zotlabs/Module/Item.php | 12 | ||||
-rwxr-xr-x | include/items.php | 5 |
3 files changed, 8 insertions, 11 deletions
diff --git a/Zotlabs/Module/Display.php b/Zotlabs/Module/Display.php index b7d4a5922..5983578b3 100644 --- a/Zotlabs/Module/Display.php +++ b/Zotlabs/Module/Display.php @@ -265,7 +265,7 @@ class Display extends \Zotlabs\Web\Controller { $sysid = $sys['channel_id']; if(local_channel()) { - $r = q("SELECT item.parent as item_id from item WHERE uid = %d and mid = '%s' $item_normal limit 1", + $r = q("SELECT item.id as item_id from item WHERE uid = %d and mid = '%s' $item_normal limit 1", intval(local_channel()), dbesc($target_item['parent_mid']) ); diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php index 11ce1d268..93df95f49 100644 --- a/Zotlabs/Module/Item.php +++ b/Zotlabs/Module/Item.php @@ -329,13 +329,13 @@ class Item extends Controller { $obj_type = ACTIVITY_OBJ_COMMENT; if($parent) { - // Get commented post data - $rr = q("SELECT parent, mid FROM item WHERE id = %d LIMIT 1", + // Get replied comment data + $reply = 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']) + intval($reply[0]['parent']) ); } elseif($parent_mid && $uid) { @@ -379,7 +379,7 @@ class Item extends Controller { // multi-level threading - preserve the info but re-parent to our single level threading - $thr_parent = $parent_mid; + $thr_parent = $reply[0]['mid']; $route = $parent_item['route']; @@ -915,7 +915,7 @@ class Item extends Controller { } if($parent_item) - $parent_mid = $rr[0]['mid']; + $parent_mid = $parent_item['mid']; // Fallback so that we alway have a thr_parent @@ -1164,7 +1164,7 @@ class Item extends Controller { 'verb' => ACTIVITY_POST, 'otype' => 'item', 'parent' => $parent, - 'parent_mid' => $rr[0]['mid'] + 'parent_mid' => $parent_item['mid'] )); } diff --git a/include/items.php b/include/items.php index 7a5c2c3c3..95b696034 100755 --- a/include/items.php +++ b/include/items.php @@ -1875,12 +1875,9 @@ 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']), |