mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-20 00:55:19 +00:00
Merge branch 'dev' of codeberg.org:streams/streams into dev
This commit is contained in:
commit
9a9b850028
1 changed files with 19 additions and 2 deletions
|
@ -292,10 +292,27 @@ class CommentApproval
|
|||
|
||||
protected function get_parent()
|
||||
{
|
||||
$result = q("select parent_mid from item where mid = '%s'",
|
||||
$result = q("select mid, replyto from item where mid = '%s'",
|
||||
dbesc($this->item['parent_mid'])
|
||||
);
|
||||
return $result ? $result[0]['parent_mid'] : '';
|
||||
if ($result) {
|
||||
$item = array_shift($result);
|
||||
if($item['replyto']) {
|
||||
// Not a Twitter-like platform. Use the conversation parent
|
||||
return $item['mid'];
|
||||
}
|
||||
else {
|
||||
$result = q("select mid from item where mid = '%s'",
|
||||
dbesc($this->item['thr_parent'])
|
||||
);
|
||||
if ($result) {
|
||||
// Twitter-like platform. Use the immediate parent
|
||||
$item = array_shift($result);
|
||||
return $item['mid'];
|
||||
}
|
||||
}
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue