diff --git a/app/lib/bangtags.rb b/app/lib/bangtags.rb
index 150150f75..8c4517acb 100644
--- a/app/lib/bangtags.rb
+++ b/app/lib/bangtags.rb
@@ -518,13 +518,12 @@ class Bangtags
@status.visibility = :direct
@status.local_only = true
@status.content_type = 'text/markdown'
- chunk = "\n# #!
admin:#{cmd[1].downcase}
:\n
#!
admin:#{cmd[1].downcase}
:\n@#{parts.join('@')}
."
+ next
+ end
output << "Silenced @#{parts.join('@')}
."
Admin::ActionLog.create(account: @account, action: :silence, target: a)
a.silence!
a.save
elsif c.match?(/^[\w\-]+\.[\w\-]+(?:\.[\w\-]+)*$/)
c.downcase!
- next if c.end_with?('monsterpit.net', 'tailma.ws')
+ if c.end_with?('monsterpit.net', 'tailma.ws')
+ output << "Skipped #{c}
."
+ next
+ end
begin
code = Request.new(:head, "https://#{c}").perform(&:code)
rescue
+ output << "Skipped #{c}
."
+ next
+ end
+ if [404, 410].include?(code)
+ output << "Skipped #{c}
."
next
end
- next if [404, 410].include?(code)
domain_block = DomainBlock.find_or_create_by(domain: c)
domain_block.severity = "silence"
domain_block.save
@@ -592,7 +601,10 @@ class Bangtags
if c.start_with?('@')
parts = c.split('@')[1..2]
a = Account.find_by(username: parts[0], domain: parts[1])
- next if a.nil?
+ if a.nil? || a.id == @account.id
+ output << "Skipped @#{parts.join('@')}
."
+ next
+ end
output << "Reset policy for @#{parts.join('@')}
."
Admin::ActionLog.create(account: @account, action: :unsilence, target: a)
a.unsilence!
@@ -601,9 +613,15 @@ class Bangtags
a.save
elsif c.match?(/^[\w\-]+\.[\w\-]+(?:\.[\w\-]+)*$/)
c.downcase!
- next if c.end_with?('monsterpit.net', 'tailma.ws')
+ if c.end_with?('monsterpit.net', 'tailma.ws')
+ output << "Skipped #{c}
."
+ next
+ end
domain_block = DomainBlock.find_by(domain: c)
- next if domain_block.nil?
+ if domain_block.nil?
+ output << "Skipped #{c}
."
+ next
+ end
output << "Reset policy for #{c}."
Admin::ActionLog.create(account: @account, action: :destroy, target: domain_block)
UnblockDomainService.new.call(domain_block)
@@ -616,19 +634,29 @@ class Bangtags
if c.start_with?('@')
parts = c.split('@')[1..2]
a = Account.find_by(username: parts[0], domain: parts[1])
- next if a.nil?
+ if a.nil? || a.id == @account.id
+ output << "Skipped @#{parts.join('@')}
."
+ next
+ end
output << "Suspended @#{parts.join('@')}
."
Admin::ActionLog.create(account: @account, action: :suspend, target: a)
SuspendAccountService.new.call(a, include_user: true)
elsif c.match?(/\A[\w\-]+\.[\w\-]+(?:\.[\w\-]+)*\Z/)
c.downcase!
- next if c.end_with?('monsterpit.net', 'tailma.ws')
+ if c.end_with?('monsterpit.net', 'tailma.ws')
+ output << "Skipped #{c}
."
+ next
+ end
begin
code = Request.new(:head, "https://#{c}").perform(&:code)
rescue
+ output << "Skipped #{c}
."
+ next
+ end
+ if [404, 410].include?(code)
+ output << "Skipped #{c}
."
next
end
- next if [404, 410].include?(code)
domain_block = DomainBlock.find_or_create_by(domain: c)
domain_block.severity = "suspend"
domain_block.reject_media = true