Skip to content

Commit

Permalink
Update Direct Messages, fix api endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
dansup committed Jun 2, 2023
1 parent eaff1a7 commit fe8728c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/Http/Controllers/Api/ApiV1Controller.php
Expand Up @@ -2447,14 +2447,17 @@ public function conversations(Request $request)
'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'];
Expand Down

0 comments on commit fe8728c

Please sign in to comment.