fix object handling

This commit is contained in:
Matthias Pfefferle 2023-07-05 15:31:06 +02:00
parent e65b70763d
commit 7a360dbf6f

View file

@ -79,7 +79,7 @@ class Activity extends Base_Object {
* @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-object-term
*
* @var string
* | ObjectType
* | Base_Objectr
* | Link
* | null
*/
@ -173,12 +173,16 @@ class Activity extends Base_Object {
*
* @see https://www.w3.org/TR/activitypub/#object-without-create
*
* @param \Activitypub\Activity\Base_Object $object
* @param string|Base_Objectr|Link|null $object
*
* @return void
*/
public function set_object( Base_Object $object ) {
parent::set_object( $object );
public function set_object( $object ) {
$this->set( 'object', $object );
if ( ! is_object( $object ) ) {
return;
}
foreach ( array( 'to', 'bto', 'cc', 'bcc', 'audience' ) as $i ) {
$this->set( $i, $object->get( $i ) );