From 901b95e93564e1adea3131e744af99e1f31fbe98 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Tue, 6 Oct 2015 06:56:31 +0200 Subject: [PATCH] Hide some profile data if not connected. --- mod/follow.php | 5 +++++ mod/notifications.php | 7 +++++++ mod/poco.php | 7 +++++++ 3 files changed, 19 insertions(+) diff --git a/mod/follow.php b/mod/follow.php index 2c8452b1bf..4a4429f2e6 100644 --- a/mod/follow.php +++ b/mod/follow.php @@ -67,6 +67,11 @@ function follow_content(&$a) { if (!$r) $r = array(array("location" => "", "about" => "", "keywords" => "")); + if($ret['network'] === NETWORK_DIASPORA) { + $r[0]["location"] = ""; + $r[0]["about"] = ""; + } + $header = $ret["name"]; if ($ret["addr"] != "") diff --git a/mod/notifications.php b/mod/notifications.php index 69ab592afe..6c0391e4e9 100644 --- a/mod/notifications.php +++ b/mod/notifications.php @@ -222,6 +222,13 @@ function notifications_content(&$a) { $header .= " (".network_to_name($rr['gnetwork'], $rr['url']).")"; + // Don't show these data until you are connected. Diaspora is doing the same. + if($rr['gnetwork'] === NETWORK_DIASPORA) { + $rr['glocation'] = ""; + $rr['gabout'] = ""; + $rr['ggender'] = ""; + } + $notif_content .= replace_macros($tpl, array( '$header' => htmlentities($header), '$str_notifytype' => t('Notification type: '), diff --git a/mod/poco.php b/mod/poco.php index f84fc964d9..4d16c6ed29 100644 --- a/mod/poco.php +++ b/mod/poco.php @@ -226,6 +226,13 @@ function poco_init(&$a) { Cache::set("about:".$rr['updated'].":".$rr['nurl'],$about); } + // Non connected persons can only see the keywords of a Diaspora account + if ($rr['network'] == NETWORK_DIASPORA) { + $rr['location'] = ""; + $about = ""; + $rr['gender'] = ""; + } + $entry = array(); if($fields_ret['id']) $entry['id'] = (int)$rr['id'];