mirror of
https://github.com/neocities/neocities.git
synced 2025-08-03 16:21:52 +02:00
bugfixes and reforms to block filters
This commit is contained in:
parent
687a134207
commit
6f7a6098a4
5 changed files with 38 additions and 3 deletions
|
@ -1,4 +1,4 @@
|
|||
class Block < Sequel::Model
|
||||
many_to_one :site
|
||||
many_to_one :actioning_site, class: :Block
|
||||
end
|
||||
many_to_one :actioning_site, class: :Site
|
||||
end
|
||||
|
|
|
@ -130,7 +130,7 @@ class Site < Sequel::Model
|
|||
DISPOSABLE_EMAIL_BLACKLIST_PATH = File.join(DIR_ROOT, 'files', 'disposable_email_blacklist.conf')
|
||||
BANNED_EMAIL_BLACKLIST_PATH = File.join(DIR_ROOT, 'files', 'banned_email_blacklist.conf')
|
||||
|
||||
BLOCK_JERK_THRESHOLD = 2
|
||||
BLOCK_JERK_THRESHOLD = 4
|
||||
MAXIMUM_TAGS = 5
|
||||
MAX_USERNAME_LENGTH = 32.freeze
|
||||
|
||||
|
@ -572,6 +572,7 @@ class Site < Sequel::Model
|
|||
|
||||
def block!(site)
|
||||
block = blockings_dataset.filter(site_id: site.id).first
|
||||
return true if block
|
||||
add_blocking site: site
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue