define ( 'REGISTER_APPROVE', 1);
define ( 'REGISTER_OPEN', 2);
-define ( 'DIRECTION_ANY', 0);
-define ( 'DIRECTION_IN', 1);
-define ( 'DIRECTION_OUT', 2);
-define ( 'DIRECTION_BOTH', 3);
+define ( 'DIRECTION_NONE', 0); // No relationship
+define ( 'DIRECTION_IN', 1); // VIP e.g. has FAN
+define ( 'DIRECTION_OUT', 2); // FAN to a VIP
+define ( 'DIRECTION_BOTH', 3); // Mutual Friends
define ( 'NOTIFY_INTRO', 0x0001 );
define ( 'NOTIFY_CONFIRM', 0x0002 );
`uid` int(11) NOT NULL COMMENT 'owner uid',
`created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`self` tinyint(1) NOT NULL DEFAULT '0',
+ `rel` tinyint(1) NOT NULL DEFAULT '0',
+ `network` char(255) NOT NULL,
`name` char(255) NOT NULL,
`photo` text NOT NULL,
`thumb` text NOT NULL,
xml_status(3);
}
+ $relation = $r[0]['rel'];
+
// Decrypt all this stuff we just received
$foreign_pubkey = $ret[0]['site-pubkey'];
$thumb = $a->get_baseurl() . '/images/default-profile-sm.jpg';
}
- $r = q("UPDATE `contact` SET `photo` = '%s', `thumb` = '%s', `name-date` = '%s', `uri-date` = '%s', `avatar-date` = '%s', `blocked` = 0, `pending` = 0 WHERE `id` = %d LIMIT 1",
+ $r = q("UPDATE `contact` SET `photo` = '%s', `thumb` = '%s', `rel` = %d, `name-date` = '%s', `uri-date` = '%s', `avatar-date` = '%s', `blocked` = 0, `pending` = 0 `network` = 'dfrn' WHERE `id` = %d LIMIT 1",
dbesc($photo),
dbesc($thumb),
+ intval(($relation == DIRECTION_IN) ? DIRECTION_BOTH: DIRECTION_OUT),
dbesc(datetime_convert()),
dbesc(datetime_convert()),
dbesc(datetime_convert()),
}
$contact_id = $r[0]['id'];
+ $relation = $r[0]['rel'];
$site_pubkey = $r[0]['site-pubkey'];
$dfrn_confirm = $r[0]['confirm'];
$aes_allow = $r[0]['aes_allow'];
$thumb = $a->get_baseurl() . '/images/default-profile-sm.jpg';
}
- $r = q("UPDATE `contact` SET `photo` = '%s', `thumb` = '%s', `name-date` = '%s', `uri-date` = '%s', `avatar-date` = '%s', `blocked` = 0, `pending` = 0 WHERE `id` = %d LIMIT 1",
+ $r = q("UPDATE `contact` SET `photo` = '%s', `thumb` = '%s', `rel` = %d, `name-date` = '%s', `uri-date` = '%s', `avatar-date` = '%s', `blocked` = 0, `pending` = 0 `network` = 'dfrn' WHERE `id` = %d LIMIT 1",
dbesc($photo),
dbesc($thumb),
+ intval(($relation == DIRECTION_OUT) ? DIRECTION_BOTH: DIRECTION_IN),
dbesc(datetime_convert()),
dbesc(datetime_convert()),
dbesc(datetime_convert()),