From: Michael Vogel Date: Fri, 24 Jul 2015 05:23:57 +0000 (+0200) Subject: Export all federation contacts through poco X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=e3e9de2e74b623a6843ee684a7978d7aa51e34b6;p=friendica.git Export all federation contacts through poco --- diff --git a/include/dbstructure.php b/include/dbstructure.php index 7d6d015a3f..e14ce64d81 100644 --- a/include/dbstructure.php +++ b/include/dbstructure.php @@ -646,6 +646,7 @@ function db_definition() { "indexes" => array( "PRIMARY" => array("id"), "nurl" => array("nurl"), + "updated" => array("updated"), ) ); $database["glink"] = array( diff --git a/include/socgraph.php b/include/socgraph.php index 7d4cca18a9..1f3536a9f2 100644 --- a/include/socgraph.php +++ b/include/socgraph.php @@ -613,8 +613,8 @@ function poco_do_update($created, $updated, $last_failure, $last_contact) { return false; // If the last contact was less than a week ago and the last failure is older than a week then don't update - if ((($now - $contact_time) < (60 * 60 * 24 * 7)) AND ($contact_time > $failure_time)) - return false; + //if ((($now - $contact_time) < (60 * 60 * 24 * 7)) AND ($contact_time > $failure_time)) + // return false; // If the last contact time was more than a week ago and the contact was created more than a week ago, then only try once a week if ((($now - $contact_time) > (60 * 60 * 24 * 7)) AND (($now - $created_time) > (60 * 60 * 24 * 7)) AND (($now - $failure_time) < (60 * 60 * 24 * 7))) diff --git a/mod/poco.php b/mod/poco.php index 0b08e30bf0..53c7f5b0b7 100644 --- a/mod/poco.php +++ b/mod/poco.php @@ -61,9 +61,12 @@ 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`) OR (`updated` >= `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')", + $r = q("SELECT count(*) AS `total` FROM `gcontact` WHERE `updated` >= '%s' AND `updated` >= `last_failure` AND `network` IN ('%s', '%s', '%s')", dbesc($update_limit), - dbesc(NETWORK_DFRN) + dbesc(NETWORK_DFRN), + dbesc(NETWORK_DIASPORA), + dbesc(NETWORK_OSTATUS) ); } elseif($system_mode) { $r = q("SELECT count(*) AS `total` FROM `contact` WHERE `self` = 1 AND `network` IN ('%s', '%s', '%s', '%s', '') @@ -96,9 +99,12 @@ function poco_init(&$a) { if ($global) { - $r = q("SELECT * FROM `gcontact` WHERE `updated` > '%s' AND `network` IN ('%s') AND ((`last_contact` >= `last_failure`) OR (`updated` > `last_failure`)) LIMIT %d, %d", + //$r = q("SELECT * FROM `gcontact` WHERE `updated` > '%s' AND `network` IN ('%s') AND ((`last_contact` >= `last_failure`) OR (`updated` > `last_failure`)) LIMIT %d, %d", + $r = q("SELECT * FROM `gcontact` WHERE `updated` > '%s' AND `network` IN ('%s', '%1', '%1') and `updated` > `last_failure` LIMIT %d, %d", dbesc($update_limit), dbesc(NETWORK_DFRN), + dbesc(NETWORK_DIASPORA), + dbesc(NETWORK_OSTATUS), intval($startIndex), intval($itemsPerPage) );