From 096093766a76450e98e7c5a00b7ed2d2d180af3b Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Wed, 12 Dec 2018 22:22:43 -0500 Subject: [PATCH] Add check for relationship with remote user for connect display --- src/Model/Profile.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Model/Profile.php b/src/Model/Profile.php index a73c8410b3..5f040f63ec 100644 --- a/src/Model/Profile.php +++ b/src/Model/Profile.php @@ -99,7 +99,7 @@ class Profile * load a lot of theme-specific content * * @brief Loads a profile into the page sidebar. - * @param object $a App + * @param App $a * @param string $nickname string * @param int $profile int * @param array $profiledata array @@ -337,6 +337,17 @@ class Profile } } + // Is the remote user already connected to that user? + if ($connect && remote_user() + && DBA::exists('contact', [ + 'uid' => $profile['uid'], + 'nurl' => Strings::normaliseLink(self::getMyURL()), + 'rel' => [Contact::SHARING, Contact::FRIEND] + ]) + ) { + $connect = false; + } + if ($connect && ($profile['network'] != Protocol::DFRN) && !isset($profile['remoteconnect'])) { $connect = false; }