]> git.mxchange.org Git - friendica.git/commitdiff
hide some contacts from others
authorfriendica <info@friendica.com>
Tue, 6 Dec 2011 02:36:26 +0000 (18:36 -0800)
committerfriendica <info@friendica.com>
Tue, 6 Dec 2011 02:36:26 +0000 (18:36 -0800)
mod/contacts.php
mod/follow.php
view/contact_edit.tpl
view/theme/duepuntozero/style.css

index 59dafd51cef0645a4d7bdb52ba1236831f3fae33..51c6920d348db5c2f93a8cc7069d2381d5843319 100644 (file)
@@ -78,6 +78,7 @@ function contacts_post(&$a) {
                }
        }
 
+       $hidden = intval($_POST['hidden']);
 
        $priority = intval($_POST['poll']);
        if($priority > 5 || $priority < 0)
@@ -85,11 +86,12 @@ function contacts_post(&$a) {
 
        $info = escape_tags(trim($_POST['info']));
 
-       $r = q("UPDATE `contact` SET `profile-id` = %d, `priority` = %d , `info` = '%s'
-               WHERE `id` = %d AND `uid` = %d LIMIT 1",
+       $r = q("UPDATE `contact` SET `profile-id` = %d, `priority` = %d , `info` = '%s',
+               `hidden` = %d WHERE `id` = %d AND `uid` = %d LIMIT 1",
                intval($profile_id),
                intval($priority),
                dbesc($info),
+               intval($hidden),
                intval($contact_id),
                intval(local_user())
        );
@@ -334,6 +336,7 @@ function contacts_content(&$a) {
                        '$info' => $contact['info'],
                        '$blocked' => (($contact['blocked']) ? t('Currently blocked') : ''),
                        '$ignored' => (($contact['readonly']) ? t('Currently ignored') : ''),
+                       '$hidden' => array('hidden', t('Hide this contact from others'), ($contact['hidden'] == 1), t('Replies/likes to your public posts <strong>may</strong> still be visible')),
                        '$photo' => $contact['photo'],
                        '$name' => $contact['name'],
                        '$dir_icon' => $dir_icon,
index 0329d1eee6195fbf99fd6c626bbd20feb430045d..2d643400a7c6748c09cf71ab461c6463a1331235 100644 (file)
@@ -67,6 +67,8 @@ function follow_post(&$a) {
        }
 
        $writeable = ((($ret['network'] === NETWORK_OSTATUS) && ($ret['notify'])) ? 1 : 0);
+       $hidden = (($ret['network'] === NETWORK_MAIL) ? 1 : 0);
+
        if($ret['network'] === NETWORK_MAIL) {
                $writeable = 1;
                
@@ -101,8 +103,8 @@ function follow_post(&$a) {
 
                // create contact record 
                $r = q("INSERT INTO `contact` ( `uid`, `created`, `url`, `nurl`, `addr`, `alias`, `batch`, `notify`, `poll`, `poco`, `name`, `nick`, `photo`, `network`, `pubkey`, `rel`, `priority`,
-                       `writable`, `blocked`, `readonly`, `pending` )
-                       VALUES ( %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, %d, 0, 0, 0 ) ",
+                       `writable`, `hidden`, `blocked`, `readonly`, `pending` )
+                       VALUES ( %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, %d, %d, 0, 0, 0 ) ",
                        intval(local_user()),
                        dbesc(datetime_convert()),
                        dbesc($ret['url']),
@@ -120,7 +122,8 @@ function follow_post(&$a) {
                        dbesc($ret['pubkey']),
                        intval($new_relation),
                        intval($ret['priority']),
-                       intval($writeable)
+                       intval($writeable),
+                       intval($hidden)
                );
        }
 
index fc6c17981f6bd67fd91d6d11fc43f7ad2b525b88..fc1a3d47b71e333b40b832e244dcdcadc7e4b1eb 100644 (file)
@@ -59,7 +59,7 @@
        {{ endif }}
        <div id="contact-edit-end" ></div>
 
-
+       {{inc field_checkbox.tpl with $field=$hidden }}{{endinc}}
 
 <div id="contact-edit-info-wrapper">
 <h4>$lbl_info1</h4>
index 0150eb1760a514a2b6a77762778ba4e93ca0ab19..1127f114510a6db15b401c91715ff8093e9a40f6 100644 (file)
@@ -1461,6 +1461,7 @@ input#dfrn-url {
 
 #contact-edit-end {
        clear: both;
+       margin-top: 15px;
 }
 
 #contact-profile-selector {