]> git.mxchange.org Git - friendica.git/commitdiff
Archive/unarchive the contacts
authorMichael <heluecht@pirati.ca>
Thu, 27 Jun 2019 05:03:58 +0000 (05:03 +0000)
committerMichael <heluecht@pirati.ca>
Thu, 27 Jun 2019 05:03:58 +0000 (05:03 +0000)
src/Model/Contact.php

index 70a152d431db9d52a8e192735c91b922680ab76a..fea011978787df9f0d57972d9f9aa539d9a42a5d 100644 (file)
@@ -1770,6 +1770,15 @@ class Contact extends BaseObject
                        return;
                }
 
+               // Archive or unarchive the contact. We only need to do this for the public contact.
+               // The archive/unarchive function will update the personal contacts by themselves.
+               $contact = DBA::selectFirst('contact', [], ['id' => $id]);
+               if (!empty($fields['success_update'])) {
+                       self::unmarkForArchival($contact);
+               } elseif (!empty($fields['failure_update'])) {
+                       self::markForArchival($contact);
+               }
+
                $condition = ['self' => false, 'nurl' => Strings::normaliseLink($url),
                        'network' => [Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::DIASPORA, Protocol::OSTATUS]];