From: friendica Date: Sun, 29 Apr 2012 04:56:17 +0000 (-0700) Subject: toggle to archive unfriends, though render them useless X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=64060f82dc68d490f3d729f3fbe139527c831fd0;p=friendica.git toggle to archive unfriends, though render them useless --- diff --git a/include/Contact.php b/include/Contact.php index 537850e007..2523fc0231 100644 --- a/include/Contact.php +++ b/include/Contact.php @@ -51,6 +51,21 @@ function user_remove($uid) { function contact_remove($id) { + + $r = q("select uid from contact where id = %d limit 1", + intval($id) + ); + if((! count($r)) || (! intval($r[0]['uid']))) + return; + + $archive = get_pconfig($r[0]['uid'], 'system','archive_removed_contacts'); + if($archive) { + q("update contact set `archive` = 1, `network` = 'none', `writable` = 0 where id = %d limit 1", + intval($id) + ); + return; + } + q("DELETE FROM `contact` WHERE `id` = %d LIMIT 1", intval($id) );