X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FWorker%2FRemoveContact.php;h=8f986eab11559c18630315429dd783910dfa9205;hb=de8787dd5bb9fadd6388c050bad35ec4c0332e08;hp=aa2325d5492e4bd67073b4fdcc1b2bfc80a47847;hpb=4e44b07dfe07dde78fe8a095fbb43d9ec1ffcb53;p=friendica.git diff --git a/src/Worker/RemoveContact.php b/src/Worker/RemoveContact.php index aa2325d549..8f986eab11 100644 --- a/src/Worker/RemoveContact.php +++ b/src/Worker/RemoveContact.php @@ -5,20 +5,22 @@ */ namespace Friendica\Worker; -use Friendica\Database\dba; +use Friendica\Database\DBA; +use Friendica\Core\Protocol; require_once 'include/dba.php'; class RemoveContact { public static function execute($id) { - // Only delete if the contact doesn't exist (anymore) - $r = dba::exists('contact', ['id' => $id]); - if ($r) { + // Only delete if the contact is to be deleted + $condition = ['network' => Protocol::PHANTOM, 'id' => $id]; + $r = DBA::exists('contact', $condition); + if (!DBA::isResult($r)) { return; } - // Now we delete all the depending table entries - dba::delete('contact', ['id' => $id]); + // Now we delete the contact and all depending tables + DBA::delete('contact', ['id' => $id]); } }