]> git.mxchange.org Git - friendica.git/blobdiff - src/Worker/OnePoll.php
Merge remote-tracking branch 'upstream/develop' into develop
[friendica.git] / src / Worker / OnePoll.php
index 2d742fc562294f5e81d58ed5ba66bff447f465c6..1190c77f5fc3e5a4db7fdeaed134accba2fc7896 100644 (file)
@@ -63,27 +63,25 @@ Class OnePoll
                        }
                }
 
-               // Diaspora users and followers we only check if they still exist.
-               if (($contact["network"] == NETWORK_DIASPORA) || ($contact["rel"] == CONTACT_IS_FOLLOWER)) {
-                       if (PortableContact::updateNeeded($contact["created"], $contact["last-item"], $contact["failure_update"], $contact["success_update"])) {
-                               $last_updated = PortableContact::lastUpdated($contact["url"]);
-                               $updated = datetime_convert();
-                               if ($last_updated) {
-                                       logger('Contact '.$contact['id'].' had last update on '.$last_updated, LOGGER_DEBUG);
-
-                                       // The last public item can be older than the last item we got
-                                       if ($last_updated < $contact['last-item']) {
-                                               $last_updated = $contact['last-item'];
-                                       }
+               // Diaspora users, archived users and followers are only checked if they still exist.
+               if ($contact['archive'] || ($contact["network"] == NETWORK_DIASPORA) || ($contact["rel"] == CONTACT_IS_FOLLOWER)) {
+                       $last_updated = PortableContact::lastUpdated($contact["url"]);
+                       $updated = datetime_convert();
+                       if ($last_updated) {
+                               logger('Contact '.$contact['id'].' had last update on '.$last_updated, LOGGER_DEBUG);
 
-                                       $fields = array('last-item' => $last_updated, 'last-update' => $updated, 'success_update' => $updated);
-                                       self::updateContact($contact, $fields);
-                                       Contact::unmarkForArchival($contact);
-                               } else {
-                                       self::updateContact($contact, array('last-update' => $updated, 'failure_update' => $updated));
-                                       Contact::markForArchival($contact);
-                                       logger('Contact '.$contact['id'].' is marked for archival', LOGGER_DEBUG);
+                               // The last public item can be older than the last item we got
+                               if ($last_updated < $contact['last-item']) {
+                                       $last_updated = $contact['last-item'];
                                }
+
+                               $fields = array('last-item' => $last_updated, 'last-update' => $updated, 'success_update' => $updated);
+                               self::updateContact($contact, $fields);
+                               Contact::unmarkForArchival($contact);
+                       } else {
+                               self::updateContact($contact, array('last-update' => $updated, 'failure_update' => $updated));
+                               Contact::markForArchival($contact);
+                               logger('Contact '.$contact['id'].' is marked for archival', LOGGER_DEBUG);
                        }
                        return;
                }
@@ -93,8 +91,8 @@ Class OnePoll
                $t = $contact['last-update'];
 
                if ($contact['subhub']) {
-                       $poll_interval = Config::get('system', 'pushpoll_frequency');
-                       $contact['priority'] = (($poll_interval !== false) ? intval($poll_interval) : 3);
+                       $poll_interval = Config::get('system', 'pushpoll_frequency', 3);
+                       $contact['priority'] = intval($poll_interval);
                        $hub_update = false;
 
                        if (datetime_convert('UTC', 'UTC', 'now') > datetime_convert('UTC', 'UTC', $t . " + 1 day")) {