From 1946def25d1efd2caf4c71dd84beffd6e23e23c4 Mon Sep 17 00:00:00 2001 From: Alex Kirk Date: Thu, 23 Jan 2025 20:20:08 +0100 Subject: [PATCH 1/2] Typo which prevented unannounces --- feed-parsers/class-feed-parser-activitypub.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/feed-parsers/class-feed-parser-activitypub.php b/feed-parsers/class-feed-parser-activitypub.php index 73319774..2635c52d 100644 --- a/feed-parsers/class-feed-parser-activitypub.php +++ b/feed-parsers/class-feed-parser-activitypub.php @@ -2275,7 +2275,8 @@ public function ajax_boost() { wp_send_json_error( 'unknown-post', array( 'id' => $post->ID ) ); } - if ( get_post_meta( get_the_ID(), 'boosted', true ) ) { + if ( get_post_meta( $post->ID, 'boosted', true ) ) { + \delete_post_meta( $post->ID, 'boosted' ); $this->mastodon_api_unreblog( $post->ID ); wp_send_json_success( 'unboosted', array( 'id' => $post->ID ) ); return; From c4928cfa1815c56a9760558acbbd91a71d04cfa9 Mon Sep 17 00:00:00 2001 From: Alex Kirk Date: Fri, 24 Jan 2025 05:05:19 +0100 Subject: [PATCH 2/2] Improve UI --- friends.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/friends.js b/friends.js index a58b5fc0..b3bcf55e 100644 --- a/friends.js +++ b/friends.js @@ -521,14 +521,27 @@ if ( 'boosted' === result ) { $this .find( 'i.friends-boost-status' ) + .removeClass( 'dashicons-warning' ) .addClass( 'dashicons dashicons-saved' ); + } else if ( 'unboosted' === result ) { + $this + .find( 'i.friends-boost-status' ) + .removeClass( 'dashicons dashicons-warning dashicons-saved' ) } else { $this .find( 'i.friends-boost-status' ) .addClass( 'dashicons dashicons-warning' ) - .removeClass( 'dashicons-saved' ); + .removeClass( 'dashicons-saved' ) + .attr( 'title', result ); } }, + fail( result ) { + $this + .find( 'i.friends-boost-status' ) + .addClass( 'dashicons dashicons-warning' ) + .removeClass( 'dashicons-saved' ) + .attr( 'title', result ); + } } ); return false; } );