diff --git a/app/Http/Controllers/StatusController.php b/app/Http/Controllers/StatusController.php index 2420816..5ef7777 100644 --- a/app/Http/Controllers/StatusController.php +++ b/app/Http/Controllers/StatusController.php @@ -13,7 +13,7 @@ class StatusController extends Controller { // The user has a session and may be here to favourite/unfavourite // a status. - if (session()->has('user')) + if (session()->has('user') && $request->has('action')) { $user = session('user'); if ($request->action === 'favourite') @@ -28,6 +28,18 @@ class StatusController extends Controller ->token($user->token) ->post('/statuses/' . $status_id . '/unfavourite'); } + elseif ($request->action === 'reblog') + { + $status = Mastodon::domain(env('MASTODON_DOMAIN')) + ->token($user->token) + ->post('/statuses/' . $status_id . '/reblog'); + } + elseif ($request->action === 'unreblog') + { + $status = Mastodon::domain(env('MASTODON_DOMAIN')) + ->token($user->token) + ->post('/statuses/' . $status_id . '/unreblog'); + } } // If the status hasn't been returned from performing an action on it, diff --git a/public/css/styles.css b/public/css/styles.css index 23f91d2..329c181 100644 --- a/public/css/styles.css +++ b/public/css/styles.css @@ -67,6 +67,10 @@ div.actions span.favourited a { color: goldenrod; } +div.actions span.reblogged a { + color: green; +} + time { font-size: smaller; margin-left: 1em; diff --git a/resources/views/show_status.blade.php b/resources/views/show_status.blade.php index 5a8a1e6..7b69ec3 100644 --- a/resources/views/show_status.blade.php +++ b/resources/views/show_status.blade.php @@ -12,6 +12,9 @@