Merge pull request #3133 from pixelfed/staging

Staging
This commit is contained in:
daniel 2022-01-07 22:10:29 -07:00 committed by GitHub
commit 4efd0b3d91
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 9 deletions

View file

@ -327,7 +327,7 @@ class PublicApiController extends Controller
return $status; return $status;
}) })
->filter(function($s) use($filtered) { ->filter(function($s) use($filtered) {
return $s && in_array($s['account']['id'], $filtered) == false; return $s && isset($s['account']) && in_array($s['account']['id'], $filtered) == false;
}) })
->values(); ->values();
$res = $timeline->toArray(); $res = $timeline->toArray();
@ -397,7 +397,7 @@ class PublicApiController extends Controller
return $status; return $status;
}) })
->filter(function($s) use($filtered) { ->filter(function($s) use($filtered) {
return in_array($s['account']['id'], $filtered) == false; return isset($s['account']) && in_array($s['account']['id'], $filtered) == false;
}) })
->values() ->values()
->toArray(); ->toArray();

View file

@ -68,6 +68,7 @@ class StatusService
$status['shortcode'], $status['shortcode'],
$status['taggedPeople'], $status['taggedPeople'],
$status['thread'], $status['thread'],
$status['pinned'],
$status['account']['header_bg'], $status['account']['header_bg'],
$status['account']['is_admin'], $status['account']['is_admin'],
$status['account']['last_fetched_at'], $status['account']['last_fetched_at'],
@ -87,6 +88,8 @@ class StatusService
$status['account']['last_status_at'] = null; $status['account']['last_status_at'] = null;
$status['media_attachments'] = array_values(MediaService::getMastodon($status['id'])); $status['media_attachments'] = array_values(MediaService::getMastodon($status['id']));
$status['muted'] = false;
$status['reblogged'] = false;
return $status; return $status;
} }

View file

@ -85,8 +85,6 @@ Route::group(['prefix' => 'api'], function() use($middleware) {
Route::group(['prefix' => 'v2'], function() use($middleware) { Route::group(['prefix' => 'v2'], function() use($middleware) {
Route::get('search', 'Api\ApiV1Controller@searchV2')->middleware($middleware); Route::get('search', 'Api\ApiV1Controller@searchV2')->middleware($middleware);
Route::get('statuses/{id}/replies', 'Api\ApiV1Controller@statusReplies')->middleware($middleware);
Route::get('statuses/{id}/state', 'Api\ApiV1Controller@statusState')->middleware($middleware);
}); });
}); });

View file

@ -151,6 +151,8 @@ Route::domain(config('pixelfed.domain.app'))->middleware(['validemail', 'twofact
Route::get('loops', 'DiscoverController@loopsApi'); Route::get('loops', 'DiscoverController@loopsApi');
Route::post('loops/watch', 'DiscoverController@loopWatch'); Route::post('loops/watch', 'DiscoverController@loopWatch');
Route::get('discover/tag', 'DiscoverController@getHashtags'); Route::get('discover/tag', 'DiscoverController@getHashtags');
Route::get('statuses/{id}/replies', 'Api\ApiV1Controller@statusReplies');
Route::get('statuses/{id}/state', 'Api\ApiV1Controller@statusState');
}); });
Route::group(['prefix' => 'pixelfed'], function() { Route::group(['prefix' => 'pixelfed'], function() {
@ -190,24 +192,24 @@ Route::domain(config('pixelfed.domain.app'))->middleware(['validemail', 'twofact
Route::get('comments/{username}/status/{postId}', 'PublicApiController@statusComments'); Route::get('comments/{username}/status/{postId}', 'PublicApiController@statusComments');
Route::get('likes/profile/{username}/status/{id}', 'PublicApiController@statusLikes'); Route::get('likes/profile/{username}/status/{id}', 'PublicApiController@statusLikes');
Route::get('shares/profile/{username}/status/{id}', 'PublicApiController@statusShares'); Route::get('shares/profile/{username}/status/{id}', 'PublicApiController@statusShares');
Route::get('status/{id}/replies', 'InternalApiController@statusReplies');
Route::post('moderator/action', 'InternalApiController@modAction'); Route::post('moderator/action', 'InternalApiController@modAction');
Route::get('discover/categories', 'InternalApiController@discoverCategories'); Route::get('discover/categories', 'InternalApiController@discoverCategories');
Route::get('loops', 'DiscoverController@loopsApi'); Route::get('loops', 'DiscoverController@loopsApi');
Route::post('loops/watch', 'DiscoverController@loopWatch'); Route::post('loops/watch', 'DiscoverController@loopWatch');
Route::get('discover/tag', 'DiscoverController@getHashtags'); Route::get('discover/tag', 'DiscoverController@getHashtags');
Route::post('status/compose', 'InternalApiController@composePost');
Route::get('discover/posts/trending', 'DiscoverController@trendingApi'); Route::get('discover/posts/trending', 'DiscoverController@trendingApi');
Route::get('discover/posts/hashtags', 'DiscoverController@trendingHashtags'); Route::get('discover/posts/hashtags', 'DiscoverController@trendingHashtags');
Route::get('discover/posts/places', 'DiscoverController@trendingPlaces'); Route::get('discover/posts/places', 'DiscoverController@trendingPlaces');
Route::get('seasonal/yir', 'SeasonalController@getData'); Route::get('seasonal/yir', 'SeasonalController@getData');
Route::post('seasonal/yir', 'SeasonalController@store'); Route::post('seasonal/yir', 'SeasonalController@store');
Route::post('status/{id}/archive', 'ApiController@archive');
Route::post('status/{id}/unarchive', 'ApiController@unarchive');
Route::get('statuses/archives', 'ApiController@archivedPosts');
Route::get('mutes', 'AccountController@accountMutesV2'); Route::get('mutes', 'AccountController@accountMutesV2');
Route::get('blocks', 'AccountController@accountBlocksV2'); Route::get('blocks', 'AccountController@accountBlocksV2');
Route::get('filters', 'AccountController@accountFiltersV2'); Route::get('filters', 'AccountController@accountFiltersV2');
Route::post('status/compose', 'InternalApiController@composePost');
Route::get('status/{id}/replies', 'InternalApiController@statusReplies');
Route::post('status/{id}/archive', 'ApiController@archive');
Route::post('status/{id}/unarchive', 'ApiController@unarchive');
Route::get('statuses/archives', 'ApiController@archivedPosts');
}); });
Route::get('discover/accounts/popular', 'Api\ApiV1Controller@discoverAccountsPopular'); Route::get('discover/accounts/popular', 'Api\ApiV1Controller@discoverAccountsPopular');