From ce515ac2e815cf6c392691743393ea6ebc42c832 Mon Sep 17 00:00:00 2001 From: Mike Macgirvin Date: Mon, 16 Aug 2010 19:38:07 -0700 Subject: prepare for federation --- mod/contacts.php | 2 +- mod/dfrn_confirm.php | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'mod') 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()), -- cgit v1.2.3