Fix confirm parameter
This commit is contained in:
parent
3153e098b0
commit
d67b676ce5
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue