]> git.mxchange.org Git - friendica.git/commitdiff
Follow up to #7582: Only update the contact when needed
authorMichael <heluecht@pirati.ca>
Sat, 31 Aug 2019 09:27:19 +0000 (09:27 +0000)
committerMichael <heluecht@pirati.ca>
Sat, 31 Aug 2019 09:27:19 +0000 (09:27 +0000)
src/Model/Contact.php

index b18ebc22d6391272e35da6b8d66d047202c23693..9d9ebe95f11334614c188879451eef9618d0fbf6 100644 (file)
@@ -904,7 +904,7 @@ class Contact extends BaseObject
        public static function unmarkForArchival(array $contact)
        {
                // Always unarchive the relay contact entry
-               if (!empty($contact['batch'])) {
+               if (!empty($contact['batch']) && !empty($contact['term-date']) && ($contact['term-date'] > DBA::NULL_DATETIME)) {
                        $fields = ['term-date' => DBA::NULL_DATETIME, 'archive' => false];
                        $condition = ['batch' => $contact['batch'], 'contact-type' => self::TYPE_RELAY];
                        DBA::update('contact', $fields, $condition);