This commit is contained in:
mgabdev
2020-12-16 02:39:07 -05:00
parent d1ff39bb81
commit 8f94ffad9c
64 changed files with 958 additions and 870 deletions

View File

@@ -14,6 +14,7 @@
# updated_at :datetime not null
# unread_count :bigint(8) default(0), not null
# chat_message_expiration_policy :string
# is_muted :boolean default(FALSE), not null
#
# : todo : expires

View File

@@ -1,29 +0,0 @@
# frozen_string_literal: true
# == Schema Information
#
# Table name: chat_mutes
#
# id :bigint(8) not null, primary key
# account_id :integer not null
# target_account_id :integer not null
# created_at :datetime not null
# updated_at :datetime not null
#
class ChatMute < ApplicationRecord
include Paginable
include RelationshipCacheable
belongs_to :account
belongs_to :target_account, class_name: 'Account'
validates :account_id, uniqueness: { scope: :target_account_id }
after_commit :remove_blocking_cache
private
def remove_blocking_cache
Rails.cache.delete("exclude_chat_account_ids_for:#{account_id}")
end
end

View File

@@ -22,6 +22,9 @@ class LinkBlock < ApplicationRecord
Addressable::URI.parse(array[0]).normalize
}
url = urls.first
return false if url.nil?
link_for_fetch = TagManager.instance.normalize_link(url)
link_for_fetch = link_for_fetch.chomp("/")