]> git.mxchange.org Git - friendica.git/blobdiff - src/Worker/AddContact.php
Coding standards
[friendica.git] / src / Worker / AddContact.php
index 6bb8a41b59ce3fa50928785249b09e1d53df3253..e61124d7770d97046e6798a6bd20274bfb0229ff 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2021, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -34,6 +34,13 @@ class AddContact
         */
        public static function execute(int $uid, string $url)
        {
+               if ($uid == 0) {
+                       // Adding public contact
+                       $result = Contact::getIdForURL($url);
+                       Logger::info('Added public contact', ['url' => $url, 'result' => $result]);
+                       return;
+               }
+
                $user = User::getById($uid);
                if (empty($user)) {
                        return;