]> git.mxchange.org Git - friendica.git/blobdiff - src/Worker/UpdateGContact.php
GContact discovery added
[friendica.git] / src / Worker / UpdateGContact.php
index 1057d0a27037142cadbb59b553897eb5eb6ebc59..0d0d85fc01d57f172fb0cc0dc8c5f205f4a148b8 100644 (file)
@@ -1,14 +1,29 @@
 <?php
-
 /**
- * @file src/Worker/UpdateGcontact.php
+ * @copyright Copyright (C) 2020, Friendica
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ *
  */
 
 namespace Friendica\Worker;
 
 use Friendica\Core\Logger;
+use Friendica\DI;
 use Friendica\Model\GContact;
-use Friendica\Database\DBA;
 
 class UpdateGContact
 {
@@ -24,5 +39,9 @@ class UpdateGContact
                $success = GContact::updateFromProbe($url, $force);
 
                Logger::info('Updated from probe', ['url' => $url, 'force' => $force, 'success' => $success]);
+
+               if ($success && DI::config()->get('system', 'gcontact_discovery')) {
+                       GContact::discoverFollowers($url);
+               }
        }
 }