Clarify which actor ActivityEvent::actor is
This commit is contained in:
parent
fe53b0ca9b
commit
c67ddcd760
@ -48,7 +48,7 @@ class AcceptHandler implements EventSubscriberInterface
|
||||
if ( $activity['type'] !== 'Accept' ) {
|
||||
return;
|
||||
}
|
||||
$localActor = $event->getActor();
|
||||
$localActor = $event->getReceivingActor();
|
||||
$followId = $activity['object'];
|
||||
if ( is_array( $followId ) && array_key_exists( 'id', $followId ) ) {
|
||||
$followId = $followId['id'];
|
||||
@ -118,7 +118,7 @@ class AcceptHandler implements EventSubscriberInterface
|
||||
if ( is_array( $followObjectId ) && array_key_exists( 'id', $followObjectId ) ) {
|
||||
$followObjectId = $followObjectId['id'];
|
||||
}
|
||||
$localActor = $event->getActor();
|
||||
$localActor = $event->getReceivingActor();
|
||||
if ( $followObjectId !== $localActor['id'] ) {
|
||||
return;
|
||||
}
|
||||
|
@ -17,11 +17,11 @@ class ActivityEvent extends Event
|
||||
protected $activity;
|
||||
|
||||
/**
|
||||
* The actor posting or receiving the activity
|
||||
* The actor whose inbox or outbox is receiving the activity
|
||||
*
|
||||
* @var ActivityPubObject
|
||||
*/
|
||||
protected $actor;
|
||||
protected $receivingActor;
|
||||
|
||||
/**
|
||||
* The current request
|
||||
@ -37,11 +37,11 @@ class ActivityEvent extends Event
|
||||
*/
|
||||
protected $response;
|
||||
|
||||
public function __construct( array $activity, ActivityPubObject $actor,
|
||||
public function __construct( array $activity, ActivityPubObject $receivingActor,
|
||||
Request $request )
|
||||
{
|
||||
$this->activity = $activity;
|
||||
$this->actor = $actor;
|
||||
$this->receivingActor = $receivingActor;
|
||||
$this->request = $request;
|
||||
}
|
||||
|
||||
@ -59,11 +59,11 @@ class ActivityEvent extends Event
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ActivityPubObject The actor
|
||||
* @return ActivityPubObject The actor whose inbox or outbox is receiving the activity
|
||||
*/
|
||||
public function getActor()
|
||||
public function getReceivingActor()
|
||||
{
|
||||
return $this->actor;
|
||||
return $this->receivingActor;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -43,7 +43,7 @@ class FollowHandler implements EventSubscriberInterface
|
||||
return;
|
||||
}
|
||||
if ( $this->autoAccepts ) {
|
||||
$localActor = $event->getActor();
|
||||
$localActor = $event->getReceivingActor();
|
||||
$objectId = $activity['object'];
|
||||
if ( is_array( $objectId ) && array_key_exists( 'id', $objectId ) ) {
|
||||
$objectId = $objectId['id'];
|
||||
|
@ -71,7 +71,7 @@ class LikeHandler implements EventSubscriberInterface
|
||||
return;
|
||||
}
|
||||
$object = $activity['object'];
|
||||
$actor = $event->getActor();
|
||||
$actor = $event->getReceivingActor();
|
||||
if ( ! $actor->hasField( 'liked' ) ) {
|
||||
$actor = $this->addCollectionToObject( $actor, 'liked' );
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ class NonActivityHandler implements EventSubscriberInterface
|
||||
if ( in_array( $object['type'], self::activityTypes() ) ) {
|
||||
return;
|
||||
}
|
||||
$actor = $event->getActor();
|
||||
$actor = $event->getReceivingActor();
|
||||
$create = $this->makeCreate( $object, $actor );
|
||||
$event->setActivity( $create );
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user