Fix following collection error message

This commit is contained in:
Diogo Cordeiro 2018-07-10 19:52:27 +01:00
parent 295d4a254d
commit 542c269885
4 changed files with 13 additions and 13 deletions

View File

@ -53,7 +53,7 @@ class apActorFollowersAction extends ManagedAction
$profile = $user->getProfile ();
$url = $profile->profileurl;
} catch (Exception $e) {
ActivityPubReturn::error ('Invalid username');
ActivityPubReturn::error ('Invalid username.');
}
if (!isset ($_GET["page"])) {
@ -63,7 +63,7 @@ class apActorFollowersAction extends ManagedAction
}
if ($page <= 0) {
ActivityPubReturn::error ('Invalid page number');
ActivityPubReturn::error ('Invalid page number.');
}
/* Fetch Followers */
@ -73,7 +73,7 @@ class apActorFollowersAction extends ManagedAction
$sub = $profile->getSubscribers ($since, $limit);
}
catch(NoResultException $e) {
ActivityPubReturn::error ('This user has no followers');
ActivityPubReturn::error ('This user has no followers.');
}
/* Calculate total items */
@ -81,11 +81,11 @@ class apActorFollowersAction extends ManagedAction
$total_pages = ceil ($total_subs / PROFILES_PER_MINILIST);
if ($total_pages == 0) {
ActivityPubReturn::error ('This user has no followers');
ActivityPubReturn::error ('This user has no followers.');
}
if ($page > $total_pages) {
ActivityPubReturn::error ("There are only {$total_pages} pages");
ActivityPubReturn::error ("There are only {$total_pages} pages.");
}
/* Get followers' URLs */

View File

@ -53,7 +53,7 @@ class apActorFollowingAction extends ManagedAction
$profile = $user->getProfile ();
$url = $profile->profileurl;
} catch (Exception $e) {
ActivityPubReturn::error ('Invalid username');
ActivityPubReturn::error ('Invalid username.');
}
if (!isset ($_GET["page"])) {
@ -63,7 +63,7 @@ class apActorFollowingAction extends ManagedAction
}
if ($page <= 0) {
ActivityPubReturn::error ('Invalid page number');
ActivityPubReturn::error ('Invalid page number.');
}
/* Fetch Following */
@ -71,8 +71,8 @@ class apActorFollowingAction extends ManagedAction
$since = ($page - 1) * PROFILES_PER_MINILIST;
$limit = (($page - 1) == 0 ? 1 : $page) * PROFILES_PER_MINILIST;
$sub = $profile->getSubscribed($since, $limit);
} catch(NoResultException $e) {
ActivityPubReturn::error ('This user is not following anyone');
} catch (NoResultException $e) {
ActivityPubReturn::error ('This user is not following anyone.');
}
/* Calculate total items */
@ -80,11 +80,11 @@ class apActorFollowingAction extends ManagedAction
$total_pages = ceil ($total_subs / PROFILES_PER_MINILIST);
if ($total_pages == 0) {
ActivityPubReturn::error ('This user has no followers');
ActivityPubReturn::error ('This user is not following anyone.');
}
if ($page > $total_pages) {
ActivityPubReturn::error ("There are only {$total_pages} pages");
ActivityPubReturn::error ("There are only {$total_pages} pages.");
}
/* Get followed' URLs */

View File

@ -53,7 +53,7 @@ class apActorLikedCollectionAction extends ManagedAction
$profile = $user->getProfile ();
$url = $profile->profileurl;
} catch (Exception $e) {
ActivityPubReturn::error ('Invalid username');
ActivityPubReturn::error ('Invalid username.');
}
$limit = intval ($this->trimmed ('limit'));

View File

@ -54,7 +54,7 @@ class apActorProfileAction extends ManagedAction
$profile = $user->getProfile ();
}
catch (Exception $e) {
ActivityPubReturn::error ('Invalid username', 404);
ActivityPubReturn::error ('Invalid username.', 404);
}
$res = Activitypub_profile::profileToObject ($profile);