From d1f6973d9b02869c9e59e7cc4221265d3e5c22b9 Mon Sep 17 00:00:00 2001 From: Matthias Pfefferle Date: Tue, 25 Apr 2023 11:59:08 +0200 Subject: [PATCH] re-add mention functionality not perfect but works as expected --- includes/class-activity-dispatcher.php | 6 ++- includes/class-mention.php | 54 +++++++++++++++++++++++++- includes/functions.php | 13 +++++-- 3 files changed, 67 insertions(+), 6 deletions(-) diff --git a/includes/class-activity-dispatcher.php b/includes/class-activity-dispatcher.php index 1e31616..e71ac19 100644 --- a/includes/class-activity-dispatcher.php +++ b/includes/class-activity-dispatcher.php @@ -67,7 +67,11 @@ class Activity_Dispatcher { $activitypub_activity = new Activity( $activity_type ); $activitypub_activity->from_post( $activitypub_post ); - $inboxes = Followers::get_inboxes( $user_id ); + $follower_inboxes = Followers::get_inboxes( $user_id ); + $mentioned_inboxes = Mention::get_inboxes( $activitypub_activity->get_cc() ); + + $inboxes = array_merge( $follower_inboxes, $mentioned_inboxes ); + $inboxes = array_unique( $inboxes ); foreach ( $inboxes as $inbox ) { $activity = $activitypub_activity->to_json(); diff --git a/includes/class-mention.php b/includes/class-mention.php index e0930cc..7167d14 100644 --- a/includes/class-mention.php +++ b/includes/class-mention.php @@ -1,6 +1,8 @@