]> git.mxchange.org Git - friendica.git/commitdiff
For test purposes we can now deactivate polling
authorMichael <heluecht@pirati.ca>
Thu, 18 Oct 2018 02:46:02 +0000 (02:46 +0000)
committerMichael <heluecht@pirati.ca>
Thu, 18 Oct 2018 02:46:02 +0000 (02:46 +0000)
config/config.ini.php
src/Worker/OnePoll.php

index 8274399843e14380216462f4234afb8d694fbb00..ea3df52cbdbdbc11c36d5ab11ea8f23dbb50b026 100644 (file)
@@ -140,6 +140,10 @@ disable_url_validation = false
 ; Disable the exposition check against the remote haveibeenpwned API on password change.
 disable_password_exposed = false
 
+; disable_polling (Boolean)
+; Disable the polling of DFRN and OStatus contacts through onepoll.php.
+disable_polling = false
+
 ; dlogfile (Path)
 ; location of the developer log file.
 dlogfile =
index 0066a04aedd06c7136576506d1e6695c3cd445f1..be6d5a549ebc6709a5f94ea5e8c95e8e35a892c9 100644 (file)
@@ -148,6 +148,10 @@ class OnePoll
                        }
                }
 
+               if (!in_array($contact['network'], [Protocol::FEED, Protocol::MAIL]) && Config::get('system', 'disable_polling')) {
+                       return;
+               }
+
                if ($importer_uid == 0) {
                        logger('Ignore public contacts');
 
@@ -345,7 +349,7 @@ class OnePoll
                } elseif ($contact['network'] === Protocol::MAIL) {
                        logger("Mail: Fetching for ".$contact['addr'], LOGGER_DEBUG);
 
-                       $mail_disabled = ((function_exists('imap_open') && (! Config::get('system', 'imap_disabled'))) ? 0 : 1);
+                       $mail_disabled = ((function_exists('imap_open') && !Config::get('system', 'imap_disabled')) ? 0 : 1);
                        if ($mail_disabled) {
                                // set the last-update so we don't keep polling
                                DBA::update('contact', ['last-update' => DateTimeFormat::utcNow()], ['id' => $contact['id']]);
@@ -541,7 +545,7 @@ class OnePoll
                                                        if ($datarray['parent-uri'] === $datarray['uri']) {
                                                                $datarray['private'] = 1;
                                                        }
-                                                       if (($contact['network'] === Protocol::MAIL) && (!PConfig::get($importer_uid, 'system', 'allow_public_email_replies'))) {
+                                                       if (($contact['network'] === Protocol::MAIL) && !PConfig::get($importer_uid, 'system', 'allow_public_email_replies')) {
                                                                $datarray['private'] = 1;
                                                                $datarray['allow_cid'] = '<' . $contact['id'] . '>';
                                                        }