]> git.mxchange.org Git - friendica.git/commitdiff
"last_contact" is now set automatically if it is lower than the update value.
authorMichael Vogel <icarus@dabo.de>
Thu, 23 Jul 2015 18:57:08 +0000 (20:57 +0200)
committerMichael Vogel <icarus@dabo.de>
Thu, 23 Jul 2015 18:57:08 +0000 (20:57 +0200)
include/socgraph.php
mod/poco.php

index 272fcea9945d955764f11b9d4efa9a588001c6bf..b9028724a21c184236f0405803b49969c8615eef 100644 (file)
@@ -223,6 +223,9 @@ function poco_check($profile_url, $name, $network, $profile_photo, $about, $loca
                $last_failure = $x[0]["last_failure"];
                $server_url = $x[0]["server_url"];
                $nick = $x[0]["nick"];
+
+               if ($updated > $last_contact)
+                       $last_contact = $updated;
        } else {
                $created = "0000-00-00 00:00:00";
                $last_contact = "0000-00-00 00:00:00";
@@ -294,7 +297,7 @@ function poco_check($profile_url, $name, $network, $profile_photo, $about, $loca
 
                if($x[0]['name'] != $name || $x[0]['photo'] != $profile_photo || $x[0]['updated'] < $updated) {
                        q("UPDATE `gcontact` SET `name` = '%s', `network` = '%s', `photo` = '%s', `connect` = '%s', `url` = '%s', `server_url` = '%s',
-                               `updated` = '%s', `location` = '%s', `about` = '%s', `keywords` = '%s', `gender` = '%s', `generation` = %d
+                               `updated` = '%s', `last_contact` = '%s', `location` = '%s', `about` = '%s', `keywords` = '%s', `gender` = '%s', `generation` = %d
                                WHERE (`generation` >= %d OR `generation` = 0) AND `nurl` = '%s'",
                                dbesc($name),
                                dbesc($network),
@@ -303,6 +306,7 @@ function poco_check($profile_url, $name, $network, $profile_photo, $about, $loca
                                dbesc($profile_url),
                                dbesc($server_url),
                                dbesc($updated),
+                               dbesc($last_contact),
                                dbesc($location),
                                dbesc($about),
                                dbesc($keywords),
index 0b62e93e388bae3da29bee5cc8665e1e6934b401..250add179f6733da2137ccd2b681290950aa10e2 100644 (file)
@@ -61,7 +61,7 @@ function poco_init(&$a) {
                $update_limit =  date("Y-m-d H:i:s",strtotime($_GET['updatedSince']));
 
        if ($global) {
-               $r = q("SELECT count(*) AS `total` FROM `gcontact` WHERE `updated` >= '%s' AND `last_contact` >= `last_failure` AND `network` IN ('%s')",
+               $r = q("SELECT count(*) AS `total` FROM `gcontact` WHERE `updated` >= '%s' AND ((`last_contact` >= `last_failure`) OR (`updated` > `last_failure`))  AND `network` IN ('%s')",
                        dbesc($update_limit),
                        dbesc(NETWORK_DFRN)
                );