Fix confirm parameter
authorPhilipp <admin@philipp.info>
Thu, 21 Oct 2021 19:41:26 +0000 (21:41 +0200)
committerPhilipp <admin@philipp.info>
Thu, 21 Oct 2021 19:57:24 +0000 (21:57 +0200)
src/Model/Contact/Introduction.php
src/Module/FollowConfirm.php

index 7524711371c1be85736a4c864b442a255122483d..f27a4a6ba84b95d72beb573c31906a41f24933f4 100644 (file)
@@ -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
+        * @param bool                $hidden
         *
         * @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 = false): 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;
index f028a3d3888fd9a7c90d5c431dcb1cf6a331b8d3..3015c3b649d498f65c52c05c56aa900af9343382 100644 (file)
@@ -3,6 +3,7 @@ namespace Friendica\Module;
 
 use Friendica\BaseModule;
 use Friendica\DI;
+use Friendica\Model\Contact;
 
 /**
  * Process follow request confirmations
@@ -23,7 +24,7 @@ class FollowConfirm extends BaseModule
 
                $intro = DI::intro()->selectOneById($intro_id, local_user());
 
-               $intro->confirm($duplex, $hidden);
+               Contact\Introduction::confirm($intro, $duplex, $hidden);
 
                DI::baseUrl()->redirect('contact/' .  $intro->cid);
        }