From dfd30d489cd3d2560bc980266a66bf3277253acf Mon Sep 17 00:00:00 2001 From: Kyle Drake Date: Wed, 17 Jul 2024 17:02:51 -0500 Subject: [PATCH] fix for comment limit not applying to profile comments --- models/site.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/models/site.rb b/models/site.rb index 225a3262..c0629c58 100644 --- a/models/site.rb +++ b/models/site.rb @@ -171,7 +171,7 @@ class Site < Sequel::Model end MAXIMUM_EMAIL_CONFIRMATIONS = 20 - MAX_COMMENTS_PER_DAY = 5 + MAX_COMMENTS_PER_DAY = 10 SANDBOX_TIME = 14.days BLACK_BOX_WAIT_TIME = 10.seconds MAX_DISPLAY_FOLLOWS = 56*3 @@ -603,16 +603,16 @@ class Site < Sequel::Model def commenting_allowed? return false if owner.commenting_banned == true - return true if owner.commenting_allowed + return false if owner.commenting_too_much? if owner.supporter? set commenting_allowed: true save_changes validate: false return true - else - return false if owner.commenting_too_much? end + return true if owner.commenting_allowed + if (account_sites_events_dataset.exclude(site_change_id: nil).count >= COMMENTING_ALLOWED_UPDATED_COUNT || (created_at < Date.new(2014, 12, 25).to_time && changed_count >= COMMENTING_ALLOWED_UPDATED_COUNT )) && created_at < Time.now - 604800 owner.set commenting_allowed: true