Commit Graph

158 Commits (2942fe5851f62960c4840545e360f25d0619727a)

Author SHA1 Message Date
Your Name b13c374f21 Guard home timeline filter against null account 2 weeks ago
Daniel Supernault a3160cdd23
Update PublicApiController, fix getStatus to use database check 2 weeks ago
Your Name 917a13d4a7 Filter null-account statuses from non-cached network timeline 2 weeks ago
Your Name 667f6e2fc9 Extract following-ids lookup into FollowerService::getFollowingIds
The Cache::remember('profile:following:'.$pid, ...) block that plucks
following_id and appends the caller's own id was copy-pasted across four
call sites, with inconsistent TTLs (1440 minutes vs 1209600 seconds).

Add FollowerService::getFollowingIds($pid), which owns the cache key that
add()/remove() already invalidate, and use it from InternalApiController,
PublicApiController, ApiV1Controller and HashtagUnfollowPipeline. Removes
the now-unused Follower/Cache imports left behind.

Adds a test covering the followed-ids-plus-self result and the
follows-nobody case.
3 weeks ago
Your Name c0cde2f682 refactor: move 52 legacy models from App\ to App\Models\
Move all Eloquent models from the app/ root directory to app/Models/
for consistency with modern Laravel conventions. The project already had
54 models in App\Models; this migrates the remaining 52 legacy models.

Changes:
- Move 52 model files from app/ to app/Models/
- Update namespace declarations in each model
- Update all ~1000 import references across the codebase
- Add Relation::morphMap() in AppServiceProvider for backward
  compatibility with existing polymorphic database records
- Add missing HasSnowflakePrimary imports for models that relied
  on same-namespace resolution
4 weeks ago
Your Name 54cfdf3c2b refactor: add return type declarations to controller methods
Adds explicit return type declarations to 498 controller methods
across 88 files. Types inferred from return statements:

- JsonResponse for response()->json() returns
- RedirectResponse for redirect()/back() returns
- View (contract) for view() returns
- Response for response() returns
- void for methods with no return value
- array for array returns
- string/int/bool for scalar returns

Also fixes 3 methods with incorrect bare returns:
- AvatarController::deleteAvatar - bare return → json response
- ImportPostController::checkPermissions - bare return → true
- RemoteAuthController::accountToId - bare return → empty array
4 weeks ago
Your Name ffcef3eb2d fix: replace Auth facade with $request->user() in request-scoped classes
Replace Auth::user() with $request->user() and Auth::check() with
$request->user() !== null (or ! $request->user()) across all
controllers and middleware that have access to the request object.

This resolves 99 larastan.noAuthFacadeInRequestScope errors and
improves Octane compatibility.

For protected helper methods without $request in scope, uses the
request() helper instead.

Methods that previously lacked a Request parameter but used Auth
facade now accept Request $request via Laravel's auto-injection.
4 weeks ago
Your Name 1617734907 Revert "Merge pull request #6851 from pixelfed/fix/phpstan-auth-request-scope-2"
This reverts commit ce4baf6995, reversing
changes made to 9235cb979a.
4 weeks ago
Your Name 0939f495bb fix: replace Auth facade with $request->user() in request-scoped classes
Replace Auth::user() with $request->user() and Auth::check() with
$request->user() !== null (or ! $request->user()) across all
controllers and middleware that have access to the request object.

This resolves 99 larastan.noAuthFacadeInRequestScope errors and
improves Octane compatibility.

For protected helper methods without $request in scope, uses the
request() helper instead.

Methods that previously lacked a Request parameter but used Auth
facade now accept Request $request via Laravel's auto-injection.
4 weeks ago
Your Name c807a8524c refactor: replace short facade aliases with fully-qualified imports
Convert all 273 short facade alias imports (e.g. 'use Cache;') to their
fully-qualified class names (e.g. 'use Illuminate\Support\Facades\Cache;')
across 193 files.

This resolves 643 PHPStan 'class.notFound' errors caused by the static
analyzer being unable to resolve global aliases, and aligns with modern
Laravel conventions. It also unblocks removing the aliases array from
config/app.php in a future change.

All 107 tests pass.
4 weeks ago
Shlee da03ca79d5
Update PublicApiController.php 8 months ago
Rm Yakovenko 7cb54eb7c2 [Bug]: public API endpoint /accounts/{id}/statuses ignores max_id parameter 10 months ago
Felipe Mateus 11a5fa9314
fix: ordery by 1 year ago
Daniel Supernault 537e179537
Update PublicApiController, fix visibility for guests 1 year ago
Daniel Supernault 5ddb6d8427
Update PublicApiController, use pixelfed entities for /api/pixelfed/v1/accounts/id/statuses with bookmarked state 1 year ago
Daniel Supernault 8082c004bc
Refactor following check 1 year ago
Daniel Supernault 0f1819125c
Update post pinning, and dispatch Notification cache warming to a job, and fix reblogged state on some endpoints 1 year ago
Daniel Supernault 2f655d0008
Fix pinned posts implementation 1 year ago
Felipe Mateus cce4c41d97
pinned posts 2 years ago
Daniel Supernault 629fb5a47a
Update PublicApiController 2 years ago
Daniel Supernault ecfc967429
Update PublicApiController 2 years ago
Daniel Supernault 679ef677b7
Update ApiController, add pe support to like/unlike endpoints 2 years ago
Daniel Supernault 01b33fb37e
Update PublicApiController, consume InstanceService blocked domains for account and statuses endpoints 3 years ago
Daniel Supernault a8ec8445a5
Update ApiV1Controller, fix home timeline bug 4 years ago
Daniel Supernault 7043cefdd4
Remove deprecated api routes 4 years ago
Daniel Supernault 1f4f8252f2
Remove deprecated api routes 4 years ago
Daniel Supernault dda9e77024
Update ApiV1Controller, add Redis facade 4 years ago
Daniel Supernault 2881b6626a
Update ApiV1Controller 4 years ago
Daniel Supernault 3328b367fd
Add optional home feed caching 4 years ago
Daniel Supernault b39f91b409
Update PublicApiController, refactor follower/following api endpoints to consume FollowerService instead of querying database 4 years ago
Daniel Supernault 5cac7fb44f
Revert nsfw posts hidden on local/network timelines by default 4 years ago
Daniel Supernault 3ebae614ce
Hide nsfw posts from public/network timelines by default 4 years ago
Daniel Supernault 2ecc314434
Update PublicApiController, remove expensive and unused relationships 4 years ago
Daniel Supernault 6033d83726
Fix unlisted post web redirect and api response 4 years ago
Daniel Supernault 03a85460af
Fix timeline infinite scroll 4 years ago
Daniel Supernault aded149fae
Update AccountController, include account entities in follow_requests.json endpoint 4 years ago
Daniel Supernault 1310d95cdb
Add NetworkTimelineService cache 4 years ago
Daniel Supernault 5bcc02ecac
Update PublicApiController, fix non-public visibility inclusion on home timeline 4 years ago
Daniel Supernault 13a6630351
Update network timeline api, limit falloff to 2 days 4 years ago
Daniel Supernault 9a7289198a
Update PublicApiController, fix edge case in timeline pagination 5 years ago
Daniel Supernault d9e4cc3df6
Update PublicApiController, return empty 403 response 5 years ago
Daniel Supernault 6ba7d43391
Updaet PublicApiController, disable legacy public access to local timeline 5 years ago
Daniel Supernault 72e3d89118
Update controller signatures, fix mysql 8 support 5 years ago
Daniel Supernault d2188e7ab3
Update PublicApiController 5 years ago
Daniel Supernault 6cfd6be523
Add ReblogService, improve reblogged state for api entities 5 years ago
Daniel Supernault 0db82ff2dd
Update PublicApiController 5 years ago
Daniel Supernault c0b1e0427e
Update PublicApiController, add bookmark state to timeline endpoints 5 years ago
Daniel Supernault dcb7ba9c7a
Update PublicApiController, fix public timeline endpoint 5 years ago
Daniel Supernault 1515a9f111
Update CommentPipeline 5 years ago
Daniel Supernault 08246f2482
Update ApiV1Controller, fix account settings bug 5 years ago