From b6000b3395167283fddee3fe9286f99c73f629d1 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 5 May 2019 11:19:30 +0000 Subject: [PATCH] Storing the protocol while following a contact --- mod/dfrn_confirm.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/mod/dfrn_confirm.php b/mod/dfrn_confirm.php index 531c164d8..302cb370e 100644 --- a/mod/dfrn_confirm.php +++ b/mod/dfrn_confirm.php @@ -162,11 +162,8 @@ function dfrn_confirm_post(App $a, $handsfree = null) $public_key = $res['pubkey']; // Save the private key. Send them the public key. - q("UPDATE `contact` SET `prvkey` = '%s' WHERE `id` = %d AND `uid` = %d", - DBA::escape($private_key), - intval($contact_id), - intval($uid) - ); + $fields = ['prvkey' => $private_key, 'protocol' => Protocol::DFRN]; + DBA::update('contact', $fields, ['id' => $contact_id]); $params = []; @@ -298,6 +295,8 @@ function dfrn_confirm_post(App $a, $handsfree = null) if ($status != 0) { return; } + } else { + DBA::update('contact', ['protocol' => $network], ['id' => $contact_id]); } /*