From 7136a39f9e4dd7adce5adb3bc13ec3ccd4c3483d Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sun, 26 Jul 2015 16:37:05 +0200 Subject: [PATCH] Discovery for unchecked contacts --- include/discover_poco.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/include/discover_poco.php b/include/discover_poco.php index 68f483dab5..bc5ee5d321 100644 --- a/include/discover_poco.php +++ b/include/discover_poco.php @@ -82,17 +82,21 @@ function discover_poco_run(&$argv, &$argc){ } function discover_users() { - $users = q("SELECT `url` FROM `gcontact` WHERE `updated` = '0000-00-00 00:00:00' AND - `last_contact` = '0000-00-00 00:00:00' AND `last_failure` = '0000-00-00 00:00:00' AND - `network` IN ('%s', '%s', '%s') ORDER BY rand() LIMIT 50", + // To-Do: Maybe we should check old contact as well. + $users = q("SELECT `url`, `created`, `updated`, `last_failure`, `last_contact` FROM `gcontact` + WHERE `updated` = '0000-00-00 00:00:00' AND `last_contact` = '0000-00-00 00:00:00' AND + `last_failure` = '0000-00-00 00:00:00' AND `network` IN ('%s', '%s', '%s') + ORDER BY rand() LIMIT 100", dbesc(NETWORK_DFRN), dbesc(NETWORK_DIASPORA), dbesc(NETWORK_OSTATUS)); if (!$users) return; foreach ($users AS $user) { - logger('Check user '.$user["url"]); - poco_last_updated($user["url"]); + if (poco_do_update($user["created"], $user["updated"], $user["last_failure"], $user["last_contact"])) { + logger('Check user '.$user["url"]); + poco_last_updated($user["url"]); + } } } -- 2.39.5