From e72e4ad29ef42cc7f0cea90d156514c0e9af3119 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Menrath?= Date: Thu, 18 Jan 2024 17:34:17 +0100 Subject: [PATCH] fix duplicate --- .../activitypub/transformer/class-events-manager.php | 5 +---- includes/activitypub/transformer/class-vs-event.php | 9 ++++----- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/includes/activitypub/transformer/class-events-manager.php b/includes/activitypub/transformer/class-events-manager.php index 7876e9a..0948f9d 100644 --- a/includes/activitypub/transformer/class-events-manager.php +++ b/includes/activitypub/transformer/class-events-manager.php @@ -216,10 +216,7 @@ class Events_Manager extends Post { if ( 'url' === $this->em_event->event_location_type ) { $attachments[] = $this->get_event_link_attachment(); } - return $attachments; - - return $attachments; - } + return $attachments; } /** * This function tries to map VS-Event categories to Mobilizon event categories. diff --git a/includes/activitypub/transformer/class-vs-event.php b/includes/activitypub/transformer/class-vs-event.php index bdd1502..711ca0f 100644 --- a/includes/activitypub/transformer/class-vs-event.php +++ b/includes/activitypub/transformer/class-vs-event.php @@ -289,17 +289,16 @@ class VS_Event extends Post { ->set_end_time() ->set_type() ->set_category() - ->set_attachments() - ->set_location() - ->set_comments_enabled( true ) + ->set_attachment() + ->set_comments_enabled( true ) ->set_external_participation_url( $this->get_url() ) ->set_status( 'CONFIRMED' ) ->set_name( get_the_title( $this->wp_object->ID ) ) ->set_is_online( false ) ->set_in_language( $this->get_locale() ) ->set_actor( get_rest_url_by_path( 'application' ) ) - ->set_to( array( 'https://www.w3.org/ns/activitystreams#Public' ) ); - + ->set_to( array( 'https://www.w3.org/ns/activitystreams#Public' ) ) + ->set_location(); return $this->ap_object; } }