]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Contact/Introduction.php
Merge pull request #12328 from nupplaphil/feat/php81_phpunit
[friendica.git] / src / Model / Contact / Introduction.php
index 7524711371c1be85736a4c864b442a255122483d..7b2f7ebc507178e5325ce829163df9b4059cb626 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2022, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -37,12 +37,14 @@ class Introduction
         * Confirms a follow request and sends a notice to the remote contact.
         *
         * @param Entity\Introduction $introduction
+        * @param bool                $duplex       Is it a follow back?
+        * @param bool|null           $hidden       Should this contact be hidden? null = no change
         *
         * @throws HTTPException\InternalServerErrorException
         * @throws HTTPException\NotFoundException
         * @throws \ImagickException
         */
-       public static function confirm(Entity\Introduction $introduction): void
+       public static function confirm(Entity\Introduction $introduction, bool $duplex = false, ?bool $hidden = null): void
        {
                DI::logger()->info('Confirming follower', ['cid' => $introduction->cid]);
 
@@ -66,7 +68,7 @@ class Introduction
                }
 
                if (in_array($protocol, [Protocol::DIASPORA, Protocol::ACTIVITYPUB])) {
-                       if ($introduction->duplex) {
+                       if ($duplex) {
                                $newRelation = Contact::FRIEND;
                        } else {
                                $newRelation = Contact::FOLLOWER;