Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions includes/table/class-following.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 ) ) );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we maybe (also) change the origin error message to be more desciptive and enduser friendly?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I think that would be good

$redirect_to = \add_query_arg( 'resource', $profile, $redirect_to );
} else {
\add_settings_error( 'activitypub', 'followed', \__( 'Account followed.', 'activitypub' ), 'success' );
}
Expand Down
5 changes: 2 additions & 3 deletions templates/following-list.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<li><p><?php echo wp_kses_post( __( 'Profile link: <code>https://example.com/@username</code>', 'activitypub' ) ); ?></p></li>
</ul>

<p><?php echo esc_html__( '(Make sure the user you&rsquo;re following is part of the fediverse and supports ActivityPub)', 'activitypub' ); ?></p>
<p><?php echo esc_html__( '(Make sure the user you&#8217;re following is part of the fediverse and supports ActivityPub)', 'activitypub' ); ?></p>
</div>
</div>
</div>
Expand All @@ -78,11 +78,10 @@
</form>
<div class="edit-term-notes">
<strong><?php esc_html_e( 'About Followings', 'activitypub' ); ?></strong>
<p class="description"><?php esc_html_e( 'When you follow another author, a follow request is sent on your behalf. If you see &#8220;Pending,&#8221; it means your follow request hasn&#8217;t been accepted yetso you aren&#8217;t following that author until they approve your request. This is a normal part of the ActivityPub protocol and helps ensure that authors have control over who follows them.', 'activitypub' ); ?></p>
<p class="description"><?php esc_html_e( 'When you follow another author, a follow request is sent on your behalf. If you see &#8220;Pending&#8221;, it means your follow request hasn&#8217;t been accepted yet&#8212;so you aren&#8217;t following that author until they approve your request. This is a normal part of the ActivityPub protocol and helps ensure that authors have control over who follows them.', 'activitypub' ); ?></p>
</div>
</div>
</div>
</div>
</div>
</div>

Loading