Skip to content

Commit 0ce46de

Browse files
authored
Ensure correct visibility handling for Undo and Follow requests (#1988)
1 parent 2a200b3 commit 0ce46de

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: patch
2+
Type: fixed
3+
4+
Ensure correct visibility handling for `Undo` and `Follow` requests

includes/collection/class-following.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public static function follow( $post, $user_id ) {
8989
$follow->set_object( $post->guid );
9090
$follow->set_to( array( $post->guid ) );
9191

92-
return add_to_outbox( $follow, null, $user_id );
92+
return add_to_outbox( $follow, null, $user_id, ACTIVITYPUB_CONTENT_VISIBILITY_PRIVATE );
9393
}
9494

9595
return $post;

includes/collection/class-outbox.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,9 @@ public static function undo( $outbox_item ) {
180180
$type = 'Remove';
181181
}
182182

183-
return add_to_outbox( $activity, $type, $outbox_item->post_author );
183+
$visibility = \get_post_meta( $outbox_item->ID, 'activitypub_content_visibility', true );
184+
185+
return add_to_outbox( $activity, $type, $outbox_item->post_author, $visibility );
184186
}
185187

186188
/**

0 commit comments

Comments
 (0)