mirror of https://git.stjo.hn/planiverse
Show statuses on the account page
Query an Account's Statuses and show them on the account page.
This commit is contained in:
parent
3d3f04ba90
commit
92689fe8c3
|
@ -6,6 +6,9 @@ use App\Http\Controllers\Controller;
|
|||
use Mastodon;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
use App\Helpers\Links;
|
||||
use App\Helpers\PaginationParameters;
|
||||
|
||||
/**
|
||||
* Controller for Account functions.
|
||||
*/
|
||||
|
@ -49,10 +52,20 @@ class AccountController extends Controller
|
|||
$relationship = $relationships[0];
|
||||
}
|
||||
|
||||
# Get the Account's Statuses from the API.
|
||||
$statuses = Mastodon::domain(env('MASTODON_DOMAIN'))
|
||||
->token($user->token)
|
||||
->get('/accounts/' . $account_id . '/statuses');
|
||||
|
||||
$vars = [
|
||||
'account' => $account,
|
||||
'mastodon_domain' => explode('//', env('MASTODON_DOMAIN'))[1],
|
||||
'relationship' => $relationship
|
||||
'relationship' => $relationship,
|
||||
'statuses' => $statuses,
|
||||
'links' => new Links(
|
||||
Mastodon::getResponse()->getHeader('link'),
|
||||
'public'
|
||||
)
|
||||
];
|
||||
|
||||
return view('account', $vars);
|
||||
|
|
|
@ -39,7 +39,19 @@
|
|||
Follow
|
||||
</a>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2>Statuses</h2>
|
||||
|
||||
<ul>
|
||||
@foreach ($statuses as $status)
|
||||
@component('status', ['status' => $status])
|
||||
@endcomponent
|
||||
@endforeach
|
||||
</ul>
|
||||
|
||||
@component('pagination', ['links' => $links])
|
||||
@endcomponent
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Reference in New Issue