Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix account statuses with a token and logged-in #119

Merged
merged 1 commit into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion includes/class-mastodon-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -962,7 +962,7 @@ public function have_token_permission( $request ) {
public function logged_in_for_private_permission( $request ) {
$post_id = $request->get_param( 'post_id' );
if ( ! $post_id ) {
return false;
return true;
}

if ( get_post_status( $post_id ) !== 'publish' ) {
Expand Down
2 changes: 1 addition & 1 deletion includes/handler/class-status.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function register_hooks() {
* @param array $data Additional status data.
* @return array The status array
*/
public function api_status( ?array $status, int $object_id, array $data = array() ): array {
public function api_status( ?array $status, int $object_id, array $data = array() ): array|null {
$comment = get_comment( $object_id );

if ( $comment instanceof \WP_Comment ) {
Expand Down