X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FWorker%2FRemoveContact.php;h=8f986eab11559c18630315429dd783910dfa9205;hb=de8787dd5bb9fadd6388c050bad35ec4c0332e08;hp=40ac937f100ed4656a3ff251eecceea7aeb4bfbe;hpb=4f2ae8868431952bd3acda1537ee899740cbf205;p=friendica.git diff --git a/src/Worker/RemoveContact.php b/src/Worker/RemoveContact.php index 40ac937f10..8f986eab11 100644 --- a/src/Worker/RemoveContact.php +++ b/src/Worker/RemoveContact.php @@ -6,19 +6,21 @@ namespace Friendica\Worker; 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 + // Now we delete the contact and all depending tables DBA::delete('contact', ['id' => $id]); } }