]> git.mxchange.org Git - friendica.git/blobdiff - include/onepoll.php
Merge pull request #3254 from Quix0r/rewrites/coding-convention-split2
[friendica.git] / include / onepoll.php
index dfb0db9e37a59ad828f7fee8315a781cf649537d..5227b61a1ab118a3066247d631b7b8677776c584 100644 (file)
@@ -61,7 +61,7 @@ function onepoll_run(&$argv, &$argc){
                intval($contact_id)
        );
 
-       if (! dbm::is_result($contacts)) {
+       if (! count($contacts)) {
                return;
        }
 
@@ -133,7 +133,7 @@ function onepoll_run(&$argv, &$argc){
 
        logger("onepoll: poll: ({$contact['id']}) IMPORTER: {$importer['name']}, CONTACT: {$contact['name']}");
 
-       $last_update = (($contact['last-update'] === '0000-00-00 00:00:00')
+       $last_update = (($contact['last-update'] <= NULL_DATE)
                ? datetime_convert('UTC','UTC','now - 7 days', ATOM_TIME)
                : datetime_convert('UTC','UTC',$contact['last-update'], ATOM_TIME)
        );
@@ -239,7 +239,7 @@ function onepoll_run(&$argv, &$argc){
                                intval($contact['id'])
                        );
                        mark_for_death($contact);
-               } elseif ($contact['term-date'] != '0000-00-00 00:00:00') {
+               } elseif ($contact['term-date'] > NULL_DATE) {
                        logger("poller: $url back from the dead - removing mark for death");
                        unmark_for_death($contact);
                }
@@ -437,18 +437,16 @@ function onepoll_run(&$argv, &$argc){
                                                if ($raw_refs) {
                                                        $refs_arr = explode(' ', $raw_refs);
                                                        if (count($refs_arr)) {
-                                                               for ($x = 0; $x < count($refs_arr); $x ++) {
+                                                               for($x = 0; $x < count($refs_arr); $x ++)
                                                                        $refs_arr[$x] = "'" . msgid2iri(str_replace(array('<','>',' '),array('','',''),dbesc($refs_arr[$x]))) . "'";
-                                                               }
                                                        }
                                                        $qstr = implode(',',$refs_arr);
                                                        $r = q("SELECT `uri` , `parent-uri` FROM `item` USE INDEX (`uid_uri`) WHERE `uri` IN ($qstr) AND `uid` = %d LIMIT 1",
                                                                intval($importer_uid)
                                                        );
-                                                       if (dbm::is_result($r)) {
+                                                       if (dbm::is_result($r))
                                                                $datarray['parent-uri'] = $r[0]['parent-uri'];  // Set the parent as the top-level item
-                                                               //$datarray['parent-uri'] = $r[0]['uri'];
-                                                       }
+       //                                                      $datarray['parent-uri'] = $r[0]['uri'];
                                                }
 
                                                // Decoding the header