aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-04-28 21:56:17 -0700
committerfriendica <info@friendica.com>2012-04-28 21:56:17 -0700
commit64060f82dc68d490f3d729f3fbe139527c831fd0 (patch)
tree124104d0b8fda2a74e15eb7c9a446ddc835c29e9
parentb3a71e4327bbe618dbdd15428a4614f58b4e848c (diff)
downloadvolse-hubzilla-64060f82dc68d490f3d729f3fbe139527c831fd0.tar.gz
volse-hubzilla-64060f82dc68d490f3d729f3fbe139527c831fd0.tar.bz2
volse-hubzilla-64060f82dc68d490f3d729f3fbe139527c831fd0.zip
toggle to archive unfriends, though render them useless
-rw-r--r--include/Contact.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/Contact.php b/include/Contact.php
index 537850e00..2523fc023 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)
);