// check upstream version?
Worker::add(PRIORITY_LOW, 'CheckVersion');
+ self::checkdeletedContacts();
+
Config::set('system', 'last_expire_day', $d2);
}
return;
}
+ /**
+ * Checks for contacts that are about to be deleted and ensures that they are removed.
+ * This should be done automatically in the "remove" function. This here is a cleanup job.
+ */
+ private static function checkdeletedContacts()
+ {
+ $contacts = DBA::select('contact', ['id'], ['deleted' => true]);
+ while ($contact = DBA::fetch($contacts)) {
+ Worker::add(PRIORITY_MEDIUM, 'RemoveContact', $contact['id']);
+ }
+ DBA::close($contacts);
+ }
+
/**
* @brief Update public contacts
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
public static function execute($id) {
// Only delete if the contact is to be deleted
- $condition = ['network' => Protocol::PHANTOM, 'id' => $id];
- $contact = DBA::selectFirst('contact', ['uid'], $condition);
+ $contact = DBA::selectFirst('contact', ['uid'], ['deleted' => true]);
if (!DBA::isResult($contact)) {
return;
}