aboutsummaryrefslogtreecommitdiffstats
path: root/include/poller.php
diff options
context:
space:
mode:
authorFabio Comuni <fabrix.xm@gmail.com>2011-09-30 14:31:20 +0200
committerFabio Comuni <fabrix.xm@gmail.com>2011-09-30 14:31:20 +0200
commit60e0f79b9f9e94b19cc412eac41e5d8f8fec2383 (patch)
tree6a42698623f3c065851f2266acd9434b4c9776ff /include/poller.php
parentdfb3ee6e29b6943f86ec75af12db5a1422a7e1dd (diff)
parent30b7c689292b3a5d06fb9c52a369b53ecb05e57f (diff)
downloadvolse-hubzilla-60e0f79b9f9e94b19cc412eac41e5d8f8fec2383.tar.gz
volse-hubzilla-60e0f79b9f9e94b19cc412eac41e5d8f8fec2383.tar.bz2
volse-hubzilla-60e0f79b9f9e94b19cc412eac41e5d8f8fec2383.zip
Merge remote-tracking branch 'friendika/master'
Diffstat (limited to 'include/poller.php')
-rw-r--r--include/poller.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/include/poller.php b/include/poller.php
index 07076508f..89a3408ec 100644
--- a/include/poller.php
+++ b/include/poller.php
@@ -44,6 +44,12 @@ function poller_run($argv, $argc){
AND `account_expires_on` != '0000-00-00 00:00:00'
AND `account_expires_on` < UTC_TIMESTAMP() ");
+ $abandon_days = intval(get_config('system','account_abandon_days'));
+ if($abandon_days < 1)
+ $abandon_days = 0;
+
+
+
// once daily run expire in background
$d1 = get_config('system','last_expire_day');
@@ -92,12 +98,17 @@ function poller_run($argv, $argc){
// and which have a polling address and ignore Diaspora since
// we are unable to match those posts with a Diaspora GUID and prevent duplicates.
+ $abandon_sql = (($abandon_days)
+ ? sprintf(" AND `user`.`login_date` > UTC_TIMESTAMP() - INTERVAL %d DAY ", intval($abandon_days))
+ : ''
+ );
+
$contacts = q("SELECT `contact`.`id` FROM `contact` LEFT JOIN `user` ON `user`.`uid` = `contact`.`uid`
WHERE ( `rel` = %d OR `rel` = %d ) AND `poll` != ''
AND `network` != '%s'
$sql_extra
AND `self` = 0 AND `contact`.`blocked` = 0 AND `contact`.`readonly` = 0
- AND `user`.`account_expired` = 0 ORDER BY RAND()",
+ AND `user`.`account_expired` = 0 $abandon_sql ORDER BY RAND()",
intval(CONTACT_IS_SHARING),
intval(CONTACT_IS_FRIEND),
dbesc(NETWORK_DIASPORA)