Friendica Communications Platform (please note that this is a clone of the repository at github, issues are handled there) https://friendi.ca
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
498B

  1. <?php
  2. /**
  3. * @file include/remove_contact.php
  4. * @brief Removes orphaned data from deleted contacts
  5. */
  6. use \Friendica\Core\Config;
  7. function remove_contact_run($argv, $argc) {
  8. if ($argc != 2) {
  9. return;
  10. }
  11. $id = intval($argv[1]);
  12. // Only delete if the contact doesn't exist (anymore)
  13. $r = q("SELECT `id` FROM `contact` WHERE `id` = %d", intval($id));
  14. if (dbm::is_result($r)) {
  15. return;
  16. }
  17. // Now we delete all the depending table entries
  18. dba::delete('contact', array('id' => $id));
  19. }