]> git.mxchange.org Git - friendica.git/blobdiff - src/Worker/RemoveUser.php
We now store the receivers as well
[friendica.git] / src / Worker / RemoveUser.php
index c2441adc90c558a54afc1d063e834c676a0aab33..e209aec07f18c23056e0f523a190df712bac65fd 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2022, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -23,6 +23,7 @@ namespace Friendica\Worker;
 
 use Friendica\Database\DBA;
 use Friendica\Model\Item;
+use Friendica\Model\Post;
 
 /**
  * Removes orphaned data from deleted users
@@ -39,11 +40,11 @@ class RemoveUser {
                // Now we delete all user items
                $condition = ['uid' => $uid, 'deleted' => false];
                do {
-                       $items = Item::select(['id'], $condition, ['limit' => 100]);
-                       while ($item = Item::fetch($items)) {
-                               Item::deleteById($item['id'], PRIORITY_NEGLIGIBLE);
+                       $items = Post::select(['id'], $condition, ['limit' => 100]);
+                       while ($item = Post::fetch($items)) {
+                               Item::markForDeletionById($item['id'], PRIORITY_NEGLIGIBLE);
                        }
                        DBA::close($items);
-               } while (Item::exists($condition));
+               } while (Post::exists($condition));
        }
 }