mirror of
https://github.com/neocities/neocities.git
synced 2025-07-25 20:08:27 +02:00
fix site unblocking
This commit is contained in:
parent
b54b2a4818
commit
6ea07df6a8
5 changed files with 39 additions and 13 deletions
|
@ -73,6 +73,9 @@ class Site < Sequel::Model
|
|||
ROOT_INDEX_HTML_REGEX = /^\/?index.html$/
|
||||
MAX_COMMENT_SIZE = 420 # Used to be the limit for Facebook.. no comment (PUN NOT INTENDED).
|
||||
MAX_FOLLOWS = 1000
|
||||
|
||||
BROWSE_MINIMUM_VIEWS = 100
|
||||
BROWSE_MINIMUM_FOLLOWER_VIEWS = 10_000
|
||||
|
||||
SCREENSHOT_DELAY_SECONDS = 30
|
||||
SCREENSHOT_RESOLUTIONS = ['540x405', '210x158', '100x100', '50x50']
|
||||
|
@ -629,6 +632,12 @@ class Site < Sequel::Model
|
|||
add_blocking site: site
|
||||
end
|
||||
|
||||
def unblock!(site)
|
||||
block = blockings_dataset.filter(site_id: site.id).first
|
||||
return true if block.nil?
|
||||
block.destroy
|
||||
end
|
||||
|
||||
def is_blocking?(site)
|
||||
@blockings ||= blockings
|
||||
!@blockings.select {|b| b.site_id == site.id}.empty?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue