]> git.mxchange.org Git - friendica.git/commitdiff
toggle to archive unfriends, though render them useless
authorfriendica <info@friendica.com>
Sun, 29 Apr 2012 04:56:17 +0000 (21:56 -0700)
committerfriendica <info@friendica.com>
Sun, 29 Apr 2012 04:56:17 +0000 (21:56 -0700)
include/Contact.php

index 537850e007400144028a13bf708d13030c9b03af..2523fc0231a594189b057738873140a3e331b748 100644 (file)
@@ -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)
        );