diff --git a/app/Http/Controllers/StatusController.php b/app/Http/Controllers/StatusController.php
index 136c3ba5..65d6a2da 100644
--- a/app/Http/Controllers/StatusController.php
+++ b/app/Http/Controllers/StatusController.php
@@ -101,6 +101,8 @@ class StatusController extends Controller
public function store(Request $request)
{
+ return;
+
$this->authCheck();
$user = Auth::user();
diff --git a/app/User.php b/app/User.php
index 509b2b91..0db0bf7c 100644
--- a/app/User.php
+++ b/app/User.php
@@ -6,10 +6,11 @@ use Laravel\Passport\HasApiTokens;
use Illuminate\Notifications\Notifiable;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Foundation\Auth\User as Authenticatable;
+use App\Util\RateLimit\User as UserRateLimit;
class User extends Authenticatable
{
- use Notifiable, SoftDeletes, HasApiTokens;
+ use Notifiable, SoftDeletes, HasApiTokens, UserRateLimit;
/**
* The attributes that should be mutated to dates.
@@ -76,4 +77,5 @@ class User extends Authenticatable
{
return $this->hasMany(UserDevice::class);
}
+
}
diff --git a/app/Util/RateLimit/User.php b/app/Util/RateLimit/User.php
new file mode 100644
index 00000000..d7d51da8
--- /dev/null
+++ b/app/Util/RateLimit/User.php
@@ -0,0 +1,26 @@
+
-
-
diff --git a/resources/views/status/compose.blade.php b/resources/views/status/compose.blade.php
index e2447f38..8ced6f0d 100644
--- a/resources/views/status/compose.blade.php
+++ b/resources/views/status/compose.blade.php
@@ -5,7 +5,10 @@
- @include('timeline.partial.new-form')
+
The Classic Compose UI has been retired.
+
+ New Post
+
@@ -19,25 +22,6 @@ $(document).ready(function() {
new Vue({
el: '#content'
});
-
- $('.metro-classic-compose textarea[name="caption"]').on('click', function(e) {
- let el = $(this);
- el.attr('rows', 4);
- });
- $('.metro-classic-compose textarea[name="caption"]').on('change keyup paste', function(e) {
- let el = $(this);
- let len = el.val().length;
- let limit = el.attr('data-limit');
-
- let res = len;
-
- if(len > limit) {
- res = '' + (limit - len) + '';
- } else {
- res = '' + len + '';
- }
- $('.metro-classic-compose .caption-counter').html(res);
- })
});
@endpush
\ No newline at end of file
diff --git a/routes/web.php b/routes/web.php
index 3d054174..fb2c9a56 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -99,7 +99,7 @@ Route::domain(config('pixelfed.domain.app'))->middleware(['validemail', 'twofact
Route::get('status/{id}/replies', 'InternalApiController@statusReplies');
Route::post('moderator/action', 'InternalApiController@modAction');
Route::get('discover/categories', 'InternalApiController@discoverCategories');
- Route::post('status/compose', 'InternalApiController@composePost');
+ Route::post('status/compose', 'InternalApiController@composePost')->middleware('throttle:maxPostsPerHour,60')->middleware('throttle:maxPostsPerDay,1440');
Route::get('loops', 'DiscoverController@loopsApi');
Route::post('loops/watch', 'DiscoverController@loopWatch');
});
@@ -115,7 +115,7 @@ Route::domain(config('pixelfed.domain.app'))->middleware(['validemail', 'twofact
Route::group(['prefix' => 'i'], function () {
Route::redirect('/', '/');
Route::get('compose', 'StatusController@compose')->name('compose');
- Route::post('comment', 'CommentController@store');
+ Route::post('comment', 'CommentController@store')->middleware('throttle:maxCommentsPerHour,60')->middleware('throttle:maxCommentsPerDay,1440');
Route::post('delete', 'StatusController@delete');
Route::post('mute', 'AccountController@mute');
Route::post('unmute', 'AccountController@unmute');
@@ -294,7 +294,6 @@ Route::domain(config('pixelfed.domain.app'))->middleware(['validemail', 'twofact
Route::group(['prefix' => 'timeline'], function () {
Route::redirect('/', '/');
Route::get('public', 'TimelineController@local')->name('timeline.public');
- Route::post('public', 'StatusController@store');
// Route::get('network', 'TimelineController@network')->name('timeline.network');
});