Fix confirm parameter

This commit is contained in:
Philipp Holzer 2021-10-21 21:41:26 +02:00
parent 3153e098b0
commit d67b676ce5
Signed by: nupplaPhil
GPG key ID: 24A7501396EB5432
2 changed files with 6 additions and 3 deletions

View 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;

View 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);
}