diff --git a/includes/table/class-following.php b/includes/table/class-following.php index d747fb52e..4a9a7146b 100644 --- a/includes/table/class-following.php +++ b/includes/table/class-following.php @@ -111,7 +111,7 @@ public function process_action() { } break; case 'follow': - $redirect_to = \remove_query_arg( array( 's' ), $redirect_to ); + $redirect_to = \remove_query_arg( array( 'resource', 's' ), $redirect_to ); if ( ! isset( $_REQUEST['activitypub-profile'], $_REQUEST['_wpnonce'] ) ) { return; @@ -125,7 +125,9 @@ public function process_action() { $profile = \sanitize_text_field( \wp_unslash( $_REQUEST['activitypub-profile'] ) ); $result = follow( $profile, $this->user_id ); if ( \is_wp_error( $result ) ) { - \add_settings_error( 'activitypub', 'followed', $result->get_error_message() ); + /* translators: %s: Account profile that could not be followed */ + \add_settings_error( 'activitypub', 'followed', \sprintf( \__( 'Unable to follow account “%s”. Please verify the account exists and try again.', 'activitypub' ), \esc_html( $profile ) ) ); + $redirect_to = \add_query_arg( 'resource', $profile, $redirect_to ); } else { \add_settings_error( 'activitypub', 'followed', \__( 'Account followed.', 'activitypub' ), 'success' ); } diff --git a/templates/following-list.php b/templates/following-list.php index 6c3bd1927..48a9bb227 100644 --- a/templates/following-list.php +++ b/templates/following-list.php @@ -63,7 +63,7 @@
https://example.com/@username', 'activitypub' ) ); ?>