aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
Diffstat (limited to 'mod')
-rw-r--r--mod/contacts.php2
-rw-r--r--mod/dfrn_confirm.php9
2 files changed, 8 insertions, 3 deletions
diff --git a/mod/contacts.php b/mod/contacts.php
index 2afa81c97..2a767102f 100644
--- a/mod/contacts.php
+++ b/mod/contacts.php
@@ -230,7 +230,7 @@ function contacts_content(&$a) {
case DIRECTION_OUT :
$sql_extra2 = " AND `dfrn-id` != '' AND `issued-id` = '' ";
break;
- case DIRECTION_ANY :
+ case DIRECTION_NONE :
default:
$sql_extra2 = '';
break;
diff --git a/mod/dfrn_confirm.php b/mod/dfrn_confirm.php
index 359ddef17..98c1488f8 100644
--- a/mod/dfrn_confirm.php
+++ b/mod/dfrn_confirm.php
@@ -44,6 +44,8 @@ function dfrn_confirm_post(&$a) {
xml_status(3);
}
+ $relation = $r[0]['rel'];
+
// Decrypt all this stuff we just received
$foreign_pubkey = $ret[0]['site-pubkey'];
@@ -116,9 +118,10 @@ function dfrn_confirm_post(&$a) {
$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()),
@@ -189,6 +192,7 @@ function dfrn_confirm_post(&$a) {
}
$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'];
@@ -325,9 +329,10 @@ function dfrn_confirm_post(&$a) {
$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()),