From: zottel Date: Fri, 2 Nov 2012 22:54:03 +0000 (+0100) Subject: Depublish public posts when archiving a contact X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=2871fd4793a6bdb2f31a3ae1b39c354d58d619ed;p=friendica.git Depublish public posts when archiving a contact --- diff --git a/include/Contact.php b/include/Contact.php index 1a7a1676a7..d39d7a28b6 100644 --- a/include/Contact.php +++ b/include/Contact.php @@ -169,6 +169,7 @@ function mark_for_death($contact) { q("update contact set `archive` = 1 where id = %d limit 1", intval($contact['id']) ); + q("UPDATE `item` SET `private` = 2 WHERE `contact-id` = %d AND `uid` = %d", intval($contact['id']), intval($contact['uid'])); //contact_remove($contact['id']); diff --git a/mod/contacts.php b/mod/contacts.php index 8a36fa4cb6..7668b45b3a 100644 --- a/mod/contacts.php +++ b/mod/contacts.php @@ -211,6 +211,9 @@ function contacts_content(&$a) { intval($contact_id), intval(local_user()) ); + if ($archived) { + q("UPDATE `item` SET `private` = 2 WHERE `contact-id` = %d AND `uid` = %d", intval($contact_id), intval(local_user())); + } if($r) { //notice( t('Contact has been ') . (($archived) ? t('archived') : t('unarchived')) . EOL ); info( (($archived) ? t('Contact has been archived') : t('Contact has been unarchived')) . EOL );