]> git.mxchange.org Git - friendica.git/commitdiff
Last old query replaced in OnePoll.php
authorMichael <heluecht@pirati.ca>
Thu, 27 Jun 2019 16:21:23 +0000 (16:21 +0000)
committerMichael <heluecht@pirati.ca>
Thu, 27 Jun 2019 16:21:23 +0000 (16:21 +0000)
src/Worker/OnePoll.php

index 3dfeacf9d931aca5b20a9d62d3be5712b7657418..13fafe2310fed20a3388c4efa5e6b6579c564b55 100644 (file)
@@ -78,14 +78,8 @@ class OnePoll
 
                // load current friends if possible.
                if (!empty($contact['poco']) && ($contact['success_update'] > $contact['failure_update'])) {
-                       $r = q("SELECT count(*) AS total FROM glink
-                               WHERE `cid` = %d AND updated > UTC_TIMESTAMP() - INTERVAL 1 DAY",
-                               intval($contact['id'])
-                       );
-                       if (DBA::isResult($r)) {
-                               if (!$r[0]['total']) {
-                                       PortableContact::loadWorker($contact['id'], $importer_uid, 0, $contact['poco']);
-                               }
+                       if (!DBA::exists('glink', ["`cid` = ? AND updated > UTC_TIMESTAMP() - INTERVAL 1 DAY", $contact['id']])) {
+                               PortableContact::loadWorker($contact['id'], $importer_uid, 0, $contact['poco']);
                        }
                }