* 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
}
}
+ // 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;
}