* friend requests.
*
* @see PDF with dfrn specs: https://github.com/friendica/friendica/blob/master/spec/dfrn2.pdf
+ * You also find a graphic which describes the confirmation process at
+ * https://github.com/friendica/friendica/blob/master/spec/dfrn2_contact_request.png
*/
require_once('include/enotify.php');
dbesc(normalise_link($dfrn_url))
);
- if(count($r)) {
+ if(dbm::is_result($r)) {
if(strlen($r[0]['dfrn-id'])) {
/*
dbesc($dfrn_url),
$parms['key'] // this was already escaped
);
- if(count($r)) {
+ if(dbm::is_result($r)) {
$def_gid = get_default_group(local_user(), $r[0]["network"]);
if(intval($def_gid))
group_add_member(local_user(), '', $r[0]['id'], $def_gid);
dbesc(datetime_convert('UTC','UTC','now - 24 hours')),
intval($uid)
);
- if(count($r) > $maxreq) {
+ if(dbm::is_result($r) > $maxreq) {
notice( sprintf( t('%s has received too many connection requests today.'), $a->profile['name']) . EOL);
notice( t('Spam protection measures have been invoked.') . EOL);
notice( t('Friends are advised to please try again in 24 hours.') . EOL);
AND `intro`.`datetime` < UTC_TIMESTAMP() - INTERVAL 30 MINUTE ",
dbesc(NETWORK_MAIL2)
);
- if(count($r)) {
+ if(dbm::is_result($r)) {
foreach($r as $rr) {
if(! $rr['rel']) {
q("DELETE FROM `contact` WHERE `id` = %d",
AND `intro`.`datetime` < UTC_TIMESTAMP() - INTERVAL 3 DAY ",
dbesc(NETWORK_MAIL2)
);
- if(count($r)) {
+ if(dbm::is_result($r)) {
foreach($r as $rr) {
if(! $rr['rel']) {
q("DELETE FROM `contact` WHERE `id` = %d",
$r = q("SELECT * FROM `mailacct` WHERE `uid` = %d LIMIT 1",
intval($uid)
);
- if(! count($r)) {
+ if(! dbm::is_result($r)) {
notice( t('This account has not been configured for email. Request failed.') . EOL);
return;
dbesc($poll),
intval($uid)
);
- if(count($r)) {
+ if(dbm::is_result($r)) {
$contact_id = $r[0]['id'];
$def_gid = get_default_group($uid, $r[0]["network"]);
$parms['url'],
$parms['issued-id']
);
- if(count($r)) {
+ if(dbm::is_result($r)) {
$contact_record = $r[0];
update_contact_avatar($photo, $uid, $contact_record["id"], true);
}
$auto_confirm = false;
- if(count($r)) {
+ if(dbm::is_result($r)) {
if(($r[0]['page-flags'] != PAGE_NORMAL) && ($r[0]['page-flags'] != PAGE_PRVGROUP))
$auto_confirm = true;
$r = q("SELECT * FROM `mailacct` WHERE `uid` = %d LIMIT 1",
intval($a->profile['uid'])
);
- if(! count($r))
+ if(! dbm::is_result($r))
$mail_disabled = 1;
}