diff options
Diffstat (limited to 'include/poller.php')
-rw-r--r-- | include/poller.php | 31 |
1 files changed, 11 insertions, 20 deletions
diff --git a/include/poller.php b/include/poller.php index bc48c3f00..f44298a9f 100644 --- a/include/poller.php +++ b/include/poller.php @@ -59,10 +59,9 @@ function poller_run($argv, $argc){ // expire any expired items $r = q("select id from item where expires != '%s' and expires < %s - and ( item_restrict & %d ) = 0 ", + and item_deleted = 0 ", dbesc(NULL_DATE), - db_utcnow(), - intval(ITEM_DELETED) + db_utcnow() ); if($r) { require_once('include/items.php'); @@ -91,15 +90,13 @@ function poller_run($argv, $argc){ // (time travel posts). Restrict to items that have come of age in the last // couple of days to limit the query to something reasonable. - $r = q("select id from item where ( item_restrict & %d ) > 0 and created <= %s and created > '%s' ", - intval(ITEM_DELAYED_PUBLISH), + $r = q("select id from item where item_delayed = 1 and created <= %s and created > '%s' ", db_utcnow(), dbesc(datetime_convert('UTC','UTC','now - 2 days')) ); if($r) { foreach($r as $rr) { - $x = q("update item set item_restrict = ( item_restrict & ~%d ) where id = %d", - intval(ITEM_DELAYED_PUBLISH), + $x = q("update item set item_delayed = 0 where id = %d", intval($rr['id']) ); if($x) { @@ -296,13 +293,11 @@ function poller_run($argv, $argc){ $randfunc = db_getfunc('RAND'); - $contacts = q("SELECT abook_id, abook_flags, abook_updated, abook_connected, abook_closeness, abook_xchan, abook_channel, xchan_network - FROM abook LEFT JOIN xchan on abook_xchan = xchan_hash LEFT JOIN account on abook_account = account_id + $contacts = q("SELECT * FROM abook LEFT JOIN xchan on abook_xchan = xchan_hash + LEFT JOIN account on abook_account = account_id + where abook_self = 0 $sql_extra - AND (( abook_flags & %d ) > 0 OR ( abook_flags = %d )) AND (( account_flags = %d ) OR ( account_flags = %d )) $abandon_sql ORDER BY $randfunc", - intval(ABOOK_FLAG_HIDDEN|ABOOK_FLAG_PENDING|ABOOK_FLAG_UNCONNECTED|ABOOK_FLAG_FEED), - intval(0), intval(ACCOUNT_OK), intval(ACCOUNT_UNVERIFIED) // FIXME @@ -312,15 +307,12 @@ function poller_run($argv, $argc){ foreach($contacts as $contact) { - if($contact['abook_flags'] & ABOOK_FLAG_SELF) - continue; - $update = false; $t = $contact['abook_updated']; $c = $contact['abook_connected']; - if($contact['abook_flags'] & ABOOK_FLAG_FEED) { + if(intval($contact['abook_feed'])) { $min = service_class_fetch($contact['abook_channel'],'minimum_feedcheck_minutes'); if(! $min) $min = intval(get_config('system','minimum_feedcheck_minutes')); @@ -359,15 +351,14 @@ function poller_run($argv, $argc){ // He's dead, Jim if(strcmp(datetime_convert('UTC','UTC', 'now'),datetime_convert('UTC','UTC', $c . " + 30 day")) > 0) { - $r = q("update abook set abook_flags = (abook_flags | %d) where abook_id = %d", - intval(ABOOK_FLAG_ARCHIVED), + $r = q("update abook set abook_archived = 1 where abook_id = %d", intval($contact['abook_id']) ); $update = false; continue; } - if($contact['abook_flags'] & ABOOK_FLAG_ARCHIVED) { + if(intval($contact['abook_archived'])) { $update = false; continue; } @@ -388,7 +379,7 @@ function poller_run($argv, $argc){ } - if($contact['abook_flags'] & (ABOOK_FLAG_PENDING|ABOOK_FLAG_ARCHIVED|ABOOK_FLAG_IGNORED)) + if(intval($contact['abook_pending']) || intval($contact['abook_archived']) || intval($contact['abook_ignored']) || intval($contact['abook_blocked'])) continue; if((! $update) && (! $force)) |