end
def media_from_xml(parent, xml)
+ return if DomainBlock.find_by(domain: parent.account.domain)&.reject_media?
+
xml.xpath('./xmlns:link[@rel="enclosure"]', xmlns: TagManager::XMLNS).each do |link|
next unless link['href']
def call(status, tags = [])
tags = status.text.scan(Tag::HASHTAG_RE).map(&:first) if status.local?
- tags.map { |str| str.mb_chars.downcase }.uniq{ |t| t.to_s }.each do |tag|
+ tags.map { |str| str.mb_chars.downcase }.uniq(&:to_s).each do |tag|
status.tags << Tag.where(name: tag).first_or_initialize(name: tag)
end
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 20170123162658) do
+ActiveRecord::Schema.define(version: 20170123203248) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
end
create_table "domain_blocks", force: :cascade do |t|
- t.string "domain", default: "", null: false
- t.datetime "created_at", null: false
- t.datetime "updated_at", null: false
- t.integer "severity", default: 0
+ t.string "domain", default: "", null: false
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ t.integer "severity", default: 0
+ t.boolean "reject_media"
t.index ["domain"], name: "index_domain_blocks_on_domain", unique: true, using: :btree
end