]> git.mxchange.org Git - friendica.git/commitdiff
Depublish public posts when archiving a contact
authorzottel <github@zottel.net>
Fri, 2 Nov 2012 22:54:03 +0000 (23:54 +0100)
committerzottel <github@zottel.net>
Fri, 2 Nov 2012 22:54:03 +0000 (23:54 +0100)
include/Contact.php
mod/contacts.php

index 1a7a1676a79bb3925a7ad0a781d025cb863b2fa9..d39d7a28b6025c41d8597323608cedefa1c21d31 100644 (file)
@@ -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']);
 
index 8a36fa4cb6ced11b63946b00bd81a4f5e0193eaf..7668b45b3a8d758759c5cb63989028165d801bdb 100644 (file)
@@ -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 );