]> git.mxchange.org Git - friendica.git/blobdiff - src/Worker/ExpirePosts.php
Merge remote-tracking branch 'upstream/develop' into user-contact
[friendica.git] / src / Worker / ExpirePosts.php
index de650f667d93156b332c56c3048e0b24e45c22fe..8d7b8c6eeaea645988048a255e55d99f453dc90f 100644 (file)
@@ -170,7 +170,7 @@ class ExpirePosts
        {
                // We have to avoid deleting newly created "item-uri" entries.
                // So we fetch a post that had been stored yesterday and only delete older ones.
-               $item = Post::selectFirst(['uri-id'], ["`uid` = ? AND `received` < UTC_TIMESTAMP() - INTERVAL ? DAY", 0, 1],
+               $item = Post::selectFirstThread(['uri-id'], ["`uid` = ? AND `received` < UTC_TIMESTAMP() - INTERVAL ? DAY", 0, 1],
                        ['order' => ['received' => true]]);
                if (empty($item['uri-id'])) {
                        Logger::warning('No item with uri-id found - we better quit here');
@@ -184,6 +184,7 @@ class ExpirePosts
                        AND NOT EXISTS(SELECT `external-id` FROM `post-user` WHERE `external-id` = `item-uri`.`id`)
                        AND NOT EXISTS(SELECT `uri-id` FROM `mail` WHERE `uri-id` = `item-uri`.`id`)
                        AND NOT EXISTS(SELECT `uri-id` FROM `event` WHERE `uri-id` = `item-uri`.`id`)
+                       AND NOT EXISTS(SELECT `uri-id` FROM `user-contact` WHERE `uri-id` = `item-uri`.`id`)
                        AND NOT EXISTS(SELECT `uri-id` FROM `contact` WHERE `uri-id` = `item-uri`.`id`)
                        AND NOT EXISTS(SELECT `uri-id` FROM `apcontact` WHERE `uri-id` = `item-uri`.`id`)
                        AND NOT EXISTS(SELECT `uri-id` FROM `fcontact` WHERE `uri-id` = `item-uri`.`id`)