]> git.mxchange.org Git - friendica.git/commitdiff
Delete the shadow post when it is the last one
authorMichael <heluecht@pirati.ca>
Tue, 15 May 2018 16:40:13 +0000 (16:40 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 15 May 2018 16:40:13 +0000 (16:40 +0000)
src/Model/Item.php

index 10e5f9e8e2609d1a325c09f921f70f1704fbb2a3..0606f017ed3946850a5986c56f5e76283eff74ff 100644 (file)
@@ -183,6 +183,10 @@ class Item extends BaseObject
                Term::insertFromFileFieldByItemId($item['id']);
                self::deleteThread($item['id'], $item['parent-uri']);
 
+               if (!dba::exists('item', ["`uri` = ? AND `uid` != 0 AND NOT `deleted`", $item['uri']])) {
+                       self::delete(['uri' => $item['uri'], 'uid' => 0, 'deleted' => false], $priority);
+               }
+
                // If it's the parent of a comment thread, kill all the kids
                if ($item['id'] == $item['parent']) {
                        self::delete(['parent' => $item['parent']], $priority);