]> git.mxchange.org Git - friendica.git/blobdiff - src/Worker/OnePoll.php
Merge pull request #4991 from annando/dbclean
[friendica.git] / src / Worker / OnePoll.php
index 42b0d9f8c4f38d876ae4bcb30d4ba32f0519e007..e42612cd31ffa10604fc7462aaaeb1b154170974 100644 (file)
@@ -78,7 +78,7 @@ class OnePoll
                                        $last_updated = $contact['last-item'];
                                }
 
-                               $fields = ['last-item' => $last_updated, 'last-update' => $updated, 'success_update' => $updated];
+                               $fields = ['last-item' => DateTimeFormat::utc($last_updated), 'last-update' => $updated, 'success_update' => $updated];
                                self::updateContact($contact, $fields);
                                Contact::unmarkForArchival($contact);
                        } else {
@@ -309,7 +309,7 @@ class OnePoll
 
                        // Are we allowed to import from this person?
 
-                       if ($contact['rel'] == CONTACT_IS_FOLLOWER || $contact['blocked'] || $contact['readonly']) {
+                       if ($contact['rel'] == CONTACT_IS_FOLLOWER || $contact['blocked']) {
                                // set the last-update so we don't keep polling
                                dba::update('contact', ['last-update' => DateTimeFormat::utcNow()], ['id' => $contact['id']]);
                                return;
@@ -582,14 +582,15 @@ class OnePoll
 
                        logger("Consume feed of contact ".$contact['id']);
 
-                       consume_feed($xml, $importer, $contact, $hub, 1, 1);
+                       consume_feed($xml, $importer, $contact, $hub);
 
-                       // do it twice. Ensures that children of parents which may be later in the stream aren't tossed
-
-                       consume_feed($xml, $importer, $contact, $hub, 1, 2);
+                       // do it a second time for DFRN so that any children find their parents.
+                       if ($contact['network'] === NETWORK_DFRN) {
+                               consume_feed($xml, $importer, $contact, $hub);
+                       }
 
                        $hubmode = 'subscribe';
-                       if ($contact['network'] === NETWORK_DFRN || $contact['blocked'] || $contact['readonly']) {
+                       if ($contact['network'] === NETWORK_DFRN || $contact['blocked']) {
                                $hubmode = 'unsubscribe';
                        }