Discovery for unchecked contacts
This commit is contained in:
parent
166519fc4d
commit
7136a39f9e
1 changed files with 9 additions and 5 deletions
|
@ -82,17 +82,21 @@ function discover_poco_run(&$argv, &$argc){
|
||||||
}
|
}
|
||||||
|
|
||||||
function discover_users() {
|
function discover_users() {
|
||||||
$users = q("SELECT `url` FROM `gcontact` WHERE `updated` = '0000-00-00 00:00:00' AND
|
// To-Do: Maybe we should check old contact as well.
|
||||||
`last_contact` = '0000-00-00 00:00:00' AND `last_failure` = '0000-00-00 00:00:00' AND
|
$users = q("SELECT `url`, `created`, `updated`, `last_failure`, `last_contact` FROM `gcontact`
|
||||||
`network` IN ('%s', '%s', '%s') ORDER BY rand() LIMIT 50",
|
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));
|
dbesc(NETWORK_DFRN), dbesc(NETWORK_DIASPORA), dbesc(NETWORK_OSTATUS));
|
||||||
|
|
||||||
if (!$users)
|
if (!$users)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
foreach ($users AS $user) {
|
foreach ($users AS $user) {
|
||||||
logger('Check user '.$user["url"]);
|
if (poco_do_update($user["created"], $user["updated"], $user["last_failure"], $user["last_contact"])) {
|
||||||
poco_last_updated($user["url"]);
|
logger('Check user '.$user["url"]);
|
||||||
|
poco_last_updated($user["url"]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue