just query for data we actually need

This commit is contained in:
Mario Vavti 2018-05-30 14:09:24 +02:00
parent 8d6441704b
commit 293e405f5b

View File

@ -71,14 +71,18 @@ class Poller {
$randfunc = db_getfunc('RAND'); $randfunc = db_getfunc('RAND');
$contacts = q("SELECT * FROM abook LEFT JOIN xchan on abook_xchan = xchan_hash $contacts = q("SELECT abook.abook_updated, abook.abook_connected, abook.abook_feed,
abook.abook_channel, abook.abook_id, abook.abook_archived, abook.abook_pending,
abook.abook_ignored, abook.abook_blocked,
xchan.xchan_network,
account.account_lastlog, account.account_flags
FROM abook LEFT JOIN xchan on abook_xchan = xchan_hash
LEFT JOIN account on abook_account = account_id LEFT JOIN account on abook_account = account_id
where abook_self = 0 where abook_self = 0
$sql_extra $sql_extra
AND (( account_flags = %d ) OR ( account_flags = %d )) $abandon_sql ORDER BY $randfunc", AND (( account_flags = %d ) OR ( account_flags = %d )) $abandon_sql ORDER BY $randfunc",
intval(ACCOUNT_OK), intval(ACCOUNT_OK),
intval(ACCOUNT_UNVERIFIED) // FIXME intval(ACCOUNT_UNVERIFIED) // FIXME
); );
if($contacts) { if($contacts) {