]> git.mxchange.org Git - friendica.git/commitdiff
Ensure that an existing contact isn't archived or pending
authorMichael <heluecht@pirati.ca>
Fri, 3 May 2019 05:54:40 +0000 (05:54 +0000)
committerMichael <heluecht@pirati.ca>
Fri, 3 May 2019 05:54:40 +0000 (05:54 +0000)
src/Model/Contact.php

index 5a5701f09a61c9d84a75d15b03977343e77df007..8b7097e3c4bdb5be72af7ca8881cb358d9063c8c 100644 (file)
@@ -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']]);
                        }