]> git.mxchange.org Git - friendica.git/blobdiff - include/poller.php
Merge branch 'pull'
[friendica.git] / include / poller.php
index 07076508ff4b233005ccc32d6c27ac96cc04fb88..cef0647b596f50de31f6c6f49454deb38f37de96 100644 (file)
@@ -44,12 +44,21 @@ function poller_run($argv, $argc){
                AND `account_expires_on` != '0000-00-00 00:00:00' 
                AND `account_expires_on` < UTC_TIMESTAMP() ");
   
-       // once daily run expire in background
+       $abandon_days = intval(get_config('system','account_abandon_days'));
+       if($abandon_days < 1)
+               $abandon_days = 0;
+
+       
+
+       // once daily run birthday_updates and then expire in background
 
        $d1 = get_config('system','last_expire_day');
        $d2 = intval(datetime_convert('UTC','UTC','now','d'));
 
        if($d2 != intval($d1)) {
+
+               update_contact_birthdays();
+
                set_config('system','last_expire_day',$d2);
                proc_run('php','include/expire.php');
        }
@@ -92,12 +101,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)
@@ -475,11 +489,11 @@ function poller_run($argv, $argc){
                                }
 
 
-                               consume_feed($xml,$importer,$contact,$hub,1, true);
+                               consume_feed($xml,$importer,$contact,$hub,1,1);
 
                                // do it twice. Ensures that children of parents which may be later in the stream aren't tossed
        
-                               consume_feed($xml,$importer,$contact,$hub,1);
+                               consume_feed($xml,$importer,$contact,$hub,1,2);
 
                                $hubmode = 'subscribe';
                                if($contact['network'] === NETWORK_DFRN || $contact['blocked'] || $contact['readonly'])