mirror of
https://github.com/friendica/friendica
synced 2025-04-27 09:10:12 +00:00
Remove contacts in the background
This commit is contained in:
parent
faefafd4f8
commit
29aa90ec09
2 changed files with 8 additions and 12 deletions
|
@ -12,13 +12,14 @@ 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 archived
|
||||
$condition = ['archive' => true, '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]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue