]> git.mxchange.org Git - friendica.git/blobdiff - include/onepoll.php
Merge pull request #1922 from annando/1510-vier-right-aside
[friendica.git] / include / onepoll.php
index e8fc97b21e9676c44cf03a34ac6c0ab130f0010a..0e58a776ca2d1c47a801561cfc18c9d71dea5135 100644 (file)
@@ -168,8 +168,18 @@ function onepoll_run(&$argv, &$argc){
        );
 
        // Update the contact entry
-       if(($contact['network'] === NETWORK_OSTATUS) || ($contact['network'] === NETWORK_DIASPORA) || ($contact['network'] === NETWORK_DFRN))
-               update_contact($contact["id"]);
+       if(($contact['network'] === NETWORK_OSTATUS) || ($contact['network'] === NETWORK_DIASPORA) || ($contact['network'] === NETWORK_DFRN)) {
+               if (!poco_reachable($contact['url'])) {
+                       logger("Skipping probably dead contact ".$contact['url']);
+                       return;
+               }
+
+               if (!update_contact($contact["id"])) {
+                       mark_for_death($contact);
+                       return;
+               } else
+                       unmark_for_death($contact);
+       }
 
        if($contact['network'] === NETWORK_DFRN) {