]> git.mxchange.org Git - friendica.git/blobdiff - src/Worker/CronJobs.php
all endpoints are now working
[friendica.git] / src / Worker / CronJobs.php
index 950dd71af6035f99a7daf62b84332e1533be2bfa..098bce4d96a0407a19be9bdbb3a2b20323fef4ea 100644 (file)
@@ -120,6 +120,12 @@ class CronJobs
                // delete user records for recently removed accounts
                $users = DBA::select('user', ['uid'], ["`account_removed` AND `account_expires_on` < UTC_TIMESTAMP() - INTERVAL 3 DAY"]);
                while ($user = DBA::fetch($users)) {
+                       // 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]);
+                       }
+
                        DBA::delete('user', ['uid' => $user['uid']]);
                }
        }