diff --git a/src/Model/Item.php b/src/Model/Item.php index 508cb691c..fc4d81e43 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -1514,13 +1514,6 @@ class Item return []; } - // If the thread originated from this node, we check the permission against the thread starter - $condition = ['uri' => $toplevel_parent['uri'], 'wall' => true]; - $localTopLevelParent = self::selectFirst(['uid'], $condition); - if (!empty($localTopLevelParent['uid']) && !self::isAllowedByUser($item, $localTopLevelParent['uid'])) { - return []; - } - return $toplevel_parent; } @@ -1689,6 +1682,13 @@ class Item return 0; } + // If the thread originated from this node, we check the permission against the thread starter + $condition = ['uri' => $toplevel_parent['uri'], 'wall' => true]; + $localTopLevelParent = self::selectFirst(['uid'], $condition); + if (!empty($localTopLevelParent['uid']) && !self::isAllowedByUser($item, $localTopLevelParent['uid'])) { + return 0; + } + $parent_id = $toplevel_parent['id']; $item['parent-uri'] = $toplevel_parent['uri']; $item['deleted'] = $toplevel_parent['deleted'];