| @@ -110,16 +110,14 @@ | ||
| 110 | 110 | |
| 111 | 111 | /** |
| 112 | 112 | * Callback for activitypub_handled_follow. |
| 113 | 113 | * |
| 114 | - * @param array $activity The ActivityPub activity data. | |
| 115 | - * @param int|int[] $user_ids The local user ID(s) of the followed actor(s). | |
| 116 | - * @param bool $success Whether the follow was handled successfully. | |
| 117 | - * @param \WP_Post|\WP_Error $context The remote actor/follower, or WP_Error on failure. | |
| 114 | + * @param array $activity The ActivityPub activity data. | |
| 115 | + * @param int|null $user_id The local user ID, or null if not applicable. | |
| 116 | + * @param mixed $state Status or WP_Error object indicating the result of the follow handling. | |
| 117 | + * @param \WP_Post|null $context The WP_Post object representing the remote actor/follower. | |
| 118 | 118 | */ |
| 119 | - public function callback_activitypub_handled_follow( $activity, $user_ids, $success, $context ) { | |
| 120 | - // The hook passes an array of user IDs; Stream's log() builds a WP_User from this, so coerce to a single integer. | |
| 121 | - $user_id = (int) ( \is_array( $user_ids ) ? \reset( $user_ids ) : $user_ids ); | |
| 119 | + public function callback_activitypub_handled_follow( $activity, $user_id, $state, $context ) { | |
| 122 | 120 | $actor_url = \is_object( $context ) && ! \is_wp_error( $context ) ? $context->guid : $activity['actor']; |
| 123 | 121 | |
| 124 | 122 | $this->log( |
| 125 | 123 | \sprintf( |
| @@ -239,8 +237,10 @@ | ||
| 239 | 237 | if ( $author_id ) { |
| 240 | 238 | $object_title = \get_userdata( $author_id )->display_name; |
| 241 | 239 | } elseif ( Actors::BLOG_USER_ID === $author_id ) { |
| 242 | 240 | $object_title = \__( 'Blog User', 'activitypub' ); |
| 241 | + } elseif ( Actors::APPLICATION_USER_ID === $author_id ) { | |
| 242 | + $object_title = \__( 'Application User', 'activitypub' ); | |
| 243 | 243 | } |
| 244 | 244 | } |
| 245 | 245 | } |
| 246 | 246 | } |