X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FWorker%2FRemoveContact.php;h=00027dca40a2e46dd2b78352a274885634ff0519;hb=4c5b97834b26745fab2f23040cc3ca87686c6e87;hp=8485adda6b5df943a490ff7f910067a5d7e74b44;hpb=c0a24d80dda2dccf44579b1ae0ddba87abead658;p=friendica.git diff --git a/src/Worker/RemoveContact.php b/src/Worker/RemoveContact.php index 8485adda6b..00027dca40 100644 --- a/src/Worker/RemoveContact.php +++ b/src/Worker/RemoveContact.php @@ -9,20 +9,18 @@ use Friendica\Database\DBA; use Friendica\Core\Protocol; use Friendica\Model\Item; -require_once 'include/dba.php'; - class RemoveContact { public static function execute($id) { // Only delete if the contact is to be deleted $condition = ['network' => Protocol::PHANTOM, 'id' => $id]; - $r = DBA::exists('contact', $condition); - if (!DBA::isResult($r)) { + $contact = DBA::selectFirst('contact', ['uid'], $condition); + if (!DBA::isResult($contact)) { return; } // Now we delete the contact and all depending tables - $condition = ['contact-id' => $id]; + $condition = ['uid' => $contact['uid'], 'contact-id' => $id]; do { $items = Item::select(['id'], $condition, ['limit' => 100]); while ($item = Item::fetch($items)) {