Merge branch 'dev' into 'dev'
Use thr_parent tp handle reply on comment feature See merge request hubzilla/core!1617
This commit is contained in:
commit
92b6026695
@ -265,7 +265,7 @@ class Display extends \Zotlabs\Web\Controller {
|
|||||||
$sysid = $sys['channel_id'];
|
$sysid = $sys['channel_id'];
|
||||||
|
|
||||||
if(local_channel()) {
|
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()),
|
intval(local_channel()),
|
||||||
dbesc($target_item['parent_mid'])
|
dbesc($target_item['parent_mid'])
|
||||||
);
|
);
|
||||||
|
@ -329,13 +329,13 @@ class Item extends Controller {
|
|||||||
$obj_type = ACTIVITY_OBJ_COMMENT;
|
$obj_type = ACTIVITY_OBJ_COMMENT;
|
||||||
|
|
||||||
if($parent) {
|
if($parent) {
|
||||||
// Get commented post data
|
// Get replied comment data
|
||||||
$rr = q("SELECT parent, mid FROM item WHERE id = %d LIMIT 1",
|
$reply = q("SELECT parent, mid FROM item WHERE id = %d LIMIT 1",
|
||||||
intval($parent)
|
intval($parent)
|
||||||
);
|
);
|
||||||
// and its parent
|
// and its parent
|
||||||
$r = q("SELECT * FROM item WHERE id = %d LIMIT 1",
|
$r = q("SELECT * FROM item WHERE id = %d LIMIT 1",
|
||||||
intval($rr[0]['parent'])
|
intval($reply[0]['parent'])
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
elseif($parent_mid && $uid) {
|
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
|
// 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'];
|
$route = $parent_item['route'];
|
||||||
|
|
||||||
@ -915,7 +915,7 @@ class Item extends Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($parent_item)
|
if($parent_item)
|
||||||
$parent_mid = $rr[0]['mid'];
|
$parent_mid = $parent_item['mid'];
|
||||||
|
|
||||||
|
|
||||||
// Fallback so that we alway have a thr_parent
|
// Fallback so that we alway have a thr_parent
|
||||||
@ -1164,7 +1164,7 @@ class Item extends Controller {
|
|||||||
'verb' => ACTIVITY_POST,
|
'verb' => ACTIVITY_POST,
|
||||||
'otype' => 'item',
|
'otype' => 'item',
|
||||||
'parent' => $parent,
|
'parent' => $parent,
|
||||||
'parent_mid' => $rr[0]['mid']
|
'parent_mid' => $parent_item['mid']
|
||||||
));
|
));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1875,12 +1875,9 @@ function item_store($arr, $allow_exec = false, $deliver = true) {
|
|||||||
// is the new message multi-level threaded?
|
// is the new message multi-level threaded?
|
||||||
// even though we don't support it now, preserve the info
|
// even though we don't support it now, preserve the info
|
||||||
// and re-attach to the conversation parent.
|
// 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']) {
|
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
|
$z = q("SELECT * FROM item WHERE mid = '%s' AND parent_mid = '%s' AND uid = %d
|
||||||
ORDER BY id ASC LIMIT 1",
|
ORDER BY id ASC LIMIT 1",
|
||||||
dbesc($r[0]['parent_mid']),
|
dbesc($r[0]['parent_mid']),
|
||||||
|
Reference in New Issue
Block a user