From b1222e174ebd03ccf3fcf6e6c4ba832211c9d7ea Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 3 May 2019 05:54:40 +0000 Subject: [PATCH] Ensure that an existing contact isn't archived or pending --- src/Model/Contact.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Model/Contact.php b/src/Model/Contact.php index 5a5701f09..8b7097e3c 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -2105,11 +2105,14 @@ class Contact extends BaseObject $network = $pub_contact['network']; if (is_array($contact)) { + // Make sure that the existing contact isn't archived + self::unmarkForArchival($contact); + $protocol = self::getProtocol($url, $contact['network']); if (($contact['rel'] == self::SHARING) || ($sharing && $contact['rel'] == self::FOLLOWER)) { - DBA::update('contact', ['rel' => self::FRIEND, 'writable' => true], + DBA::update('contact', ['rel' => self::FRIEND, 'writable' => true, 'pending' => false], ['id' => $contact['id'], 'uid' => $importer['uid']]); }