X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FWorker%2FRemoveContact.php;h=8f986eab11559c18630315429dd783910dfa9205;hb=514ec1be6df161df5cb48c033917ac2e94484f0f;hp=4098d66bc59648c227fc170b187356c76209b5d7;hpb=394e94cbc1b3a11e50cd6b076582403d62839c86;p=friendica.git diff --git a/src/Worker/RemoveContact.php b/src/Worker/RemoveContact.php index 4098d66bc5..8f986eab11 100644 --- a/src/Worker/RemoveContact.php +++ b/src/Worker/RemoveContact.php @@ -5,21 +5,22 @@ */ namespace Friendica\Worker; -use Friendica\Core\Config; -use 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', array('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', array('id' => $id)); + // Now we delete the contact and all depending tables + DBA::delete('contact', ['id' => $id]); } }