]> git.mxchange.org Git - friendica.git/blobdiff - src/Worker/ExpireAndRemoveUsers.php
Replaced most "api_get_user" calls with newer BaseApi calls
[friendica.git] / src / Worker / ExpireAndRemoveUsers.php
index 949b7dea9f26839fd0f220e343c9d78e7809a3d1..c2da44d3699e4728c4b71f912c7c6c9b23da8a52 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2021, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -58,6 +58,12 @@ class ExpireAndRemoveUsers
                        Photo::delete(['uid' => $user['uid']]);
 
                        // Delete the contacts of this user
+                       $self = DBA::selectFirst('contact', ['nurl'], ['self' => true, 'uid' => $user['uid']]);
+                       if (DBA::isResult($self)) {
+                               DBA::delete('contact', ['nurl' => $self['nurl'], 'self' => false]);
+                       }
+
+                       // Delete all contacts of this user
                        DBA::delete('contact', ['uid' => $user['uid']]);
 
                        // These tables contain the permissionset which will also be deleted when a user is deleted.