From 14fb5038004919c1972d90a3233c884f2a810ad6 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 30 Dec 2012 16:14:29 -0800 Subject: progress on poller --- include/onepoll.php | 71 +++++++++++++++++++++++------------------------------ 1 file changed, 31 insertions(+), 40 deletions(-) (limited to 'include/onepoll.php') diff --git a/include/onepoll.php b/include/onepoll.php index 1ac38823a..3dd800a04 100644 --- a/include/onepoll.php +++ b/include/onepoll.php @@ -1,37 +1,14 @@ set_baseurl(get_config('system','baseurl')); - load_hooks(); + cli_startup(); + $a = get_app(); logger('onepoll: start'); @@ -52,27 +29,41 @@ function onepoll_run($argv, $argc){ $d = datetime_convert(); - // Only poll from those with suitable relationships, - $contacts = q("SELECT `contact`.* FROM `contact` - WHERE ( `rel` = %d OR `rel` = %d ) AND `poll` != '' - AND `contact`.`id` = %d - AND `self` = 0 AND `contact`.`blocked` = 0 AND `contact`.`readonly` = 0 - AND `contact`.`archive` = 0 LIMIT 1", - intval(CONTACT_IS_SHARING), - intval(CONTACT_IS_FRIEND), - intval($contact_id) + +// FIXME +return; + + + + $contacts = q("SELECT abook.*, account.* + FROM abook LEFT JOIN account on abook_account = account_id + AND abook_id = %d + AND not ( abook_flags & %d ) AND not ( abook_flags & %d ) + AND not ( abook_flags & %d ) AND not ( abook_flags & %d ) + AND not ( abook_flags & %d ) AND ( account_flags & %d ) $abandon_sql ORDER BY RAND()", + intval($contact_id), + intval(ABOOK_FLAG_BLOCKED), + intval(ABOOK_FLAG_IGNORED), + intval(ABOOK_FLAG_PENDING), + intval(ABOOK_FLAG_ARCHIVED), + intval(ABOOK_FLAG_SELF), + intval(ACCOUNT_OK) ); - if(! count($contacts)) { + if(! $contacts) { return; } + if(! $contacts) + return; + $contact = $contacts[0]; + $t = $contact['abook_updated']; + - $xml = false; +// end of last edits - $t = $contact['last_update']; $importer_uid = $contact['uid']; -- cgit v1.2.3