Restructured "dba::exists" function

This commit is contained in:
Michael 2017-08-12 08:55:50 +00:00
parent b14b44e8a8
commit 1d8c91c478
9 changed files with 33 additions and 35 deletions

View file

@ -245,10 +245,7 @@ function profile_sidebar($profile, $block = 0) {
$profile_url = normalise_link(App::get_baseurl()."/profile/".$profile["nickname"]);
}
$r = dba::select('contact', array('id'),
array('pending' => false, 'uid' => local_user(), 'nurl' => $profile_url), array('limit' => 1));
if (dbm::is_result($r))
$connect = false;
$connect = !dba::exists('contact', array('pending' => false, 'uid' => local_user(), 'nurl' => $profile_url));
}
if ($connect && ($profile['network'] != NETWORK_DFRN) && !isset($profile['remoteconnect']))