From fe8728c0ba2e03d516a612a08c0a62dc7e72d0b0 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Fri, 2 Jun 2023 06:45:14 -0600 Subject: [PATCH 1/2] Update Direct Messages, fix api endpoint --- app/Http/Controllers/Api/ApiV1Controller.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Api/ApiV1Controller.php b/app/Http/Controllers/Api/ApiV1Controller.php index 011e9ac87..f2338f91e 100644 --- a/app/Http/Controllers/Api/ApiV1Controller.php +++ b/app/Http/Controllers/Api/ApiV1Controller.php @@ -2447,14 +2447,17 @@ class ApiV1Controller extends Controller 'id' => $dm->id, 'unread' => false, 'accounts' => [ - AccountService::getMastodon($from) + AccountService::getMastodon($from, true) ], 'last_status' => StatusService::getDirectMessage($dm->status_id) ]; return $res; }) ->filter(function($dm) { - return isset($dm['accounts']) && count($dm['accounts']) && !empty($dm['last_status']); + if(!$dm || empty($dm['last_status']) || !isset($dm['accounts']) || !count($dm['accounts']) || !isset($dm['accounts'][0]) || !isset($dm['accounts'][0]['id'])) { + return false; + } + return true; }) ->unique(function($item, $key) { return $item['accounts'][0]['id']; From fccd927c0b7347227fcc1c9dd29f32c066f51ccf Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Fri, 2 Jun 2023 06:45:49 -0600 Subject: [PATCH 2/2] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d31100c0a..b0504ece5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ### Updates - Update Notifications.vue component, fix filtering logic to prevent endless spinner ([3df9b53f](https://github.com/pixelfed/pixelfed/commit/3df9b53f)) +- Update Direct Messages, fix api endpoint ([fe8728c0](https://github.com/pixelfed/pixelfed/commit/fe8728c0)) - ([](https://github.com/pixelfed/pixelfed/commit/)) ## [v0.11.8 (2023-05-29)](https://github.com/pixelfed/pixelfed/compare/v0.11.7...v0.11.8)