]> git.mxchange.org Git - friendica.git/blobdiff - src/Worker/RemoveContact.php
Changed comment
[friendica.git] / src / Worker / RemoveContact.php
index 40ac937f100ed4656a3ff251eecceea7aeb4bfbe..8f986eab11559c18630315429dd783910dfa9205 100644 (file)
@@ -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]);
        }
 }