link_header (~> 0.0, >= 0.0.8)
rdf-normalize (0.4.0)
rdf (~> 3.1)
- redis (4.2.1)
+ redcarpet (3.5.0)
+ redis (4.2.2)
redis-actionpack (5.2.0)
actionpack (>= 5, < 7)
redis-rack (>= 2.1.0, < 3)
paginated_mutes.map(&:target_account)
end
+ def load_mutes
+ paginated_mutes.includes(:account, :target_account).to_a
+ end
+
def paginated_mutes
@paginated_mutes ||= Mute.eager_load(:target_account)
+ .joins(:target_account)
+ .merge(Account.without_suspended)
.where(account: current_account)
.paginate_by_max_id(
limit_param(DEFAULT_ACCOUNTS_LIMIT),
before_action :store_current_location
before_action :authenticate_resource_owner!
+ before_action :set_pack
+ before_action :require_not_suspended!, only: :destroy
before_action :set_body_classes
skip_before_action :require_functional!
store_location_for(:user, request.url)
end
+ def set_pack
+ use_pack 'settings'
+ end
++
+ def require_not_suspended!
+ forbidden if current_account.suspended?
+ end
end
# frozen_string_literal: true
class Settings::BaseController < ApplicationController
+ before_action :set_pack
+ layout 'admin'
+
+ before_action :authenticate_user!
before_action :set_body_classes
before_action :set_cache_headers
# frozen_string_literal: true
class Settings::IdentityProofsController < Settings::BaseController
- layout 'admin'
-
- before_action :authenticate_user!
before_action :check_required_params, only: :new
+ before_action :check_enabled, only: :new
def index
@proofs = AccountIdentityProof.where(account: current_account).order(provider: :asc, provider_username: :asc)
end
def functional?
- confirmed? && approved? && !disabled? && !account.suspended?
- confirmed? && approved? && !disabled? && !account.suspended? && !account.memorial? && account.moved_to_account_id.nil?
++ confirmed? && approved? && !disabled? && !account.suspended? && !account.memorial?
end
def unconfirmed_or_pending?
end
def show?
+ return false if author.suspended?
+ return false if local_only? && (current_account.nil? || !current_account.local?)
if requires_mention?
owned? || mention_exists?
object.last_status_at&.to_date&.iso8601
end
+ def followers_count
+ (Setting.hide_followers_count || object.user&.setting_hide_followers_count) ? -1 : object.followers_count
+ end
++
+ def display_name
+ object.suspended? ? '' : object.display_name
+ end
+
+ def locked
+ object.suspended? ? false : object.locked
+ end
+
+ def bot
+ object.suspended? ? false : object.bot
+ end
+
+ def discoverable
+ object.suspended? ? false : object.discoverable
+ end
+
+ def moved_to_account
+ object.suspended? ? nil : object.moved_to_account
+ end
+
+ def emojis
+ object.suspended? ? [] : object.emojis
+ end
+
+ def fields
+ object.suspended? ? [] : object.fields
+ end
+
+ def suspended
+ object.suspended?
+ end
+
+ delegate :suspended?, to: :object
+
+ def moved_and_not_nested?
+ object.moved? && object.moved_to_account.moved_to_account_id.nil?
+ end
end
mentioned_account = mention.account
if mentioned_account.local?
- LocalNotificationWorker.perform_async(mentioned_account.id, mention.id, mention.class.name)
+ LocalNotificationWorker.perform_async(mentioned_account.id, mention.id, mention.class.name, :mention)
- elsif mentioned_account.activitypub?
+ elsif mentioned_account.activitypub? && !@status.local_only?
ActivityPub::DeliveryWorker.perform_async(activitypub_json, mention.status.account_id, mentioned_account.inbox_url)
end
end
FeedManager.instance.push_to_home(@follower, @status)
when :list
FeedManager.instance.push_to_list(@list, @status)
+ when :direct
+ FeedManager.instance.push_to_direct(@account, @status)
end
end
+
+ def perform_notify
+ NotifyService.new.call(@follower, :status, @status)
+ end
end
"@babel/runtime": "^7.11.2",
"@clusterws/cws": "^3.0.0",
"@gamestdio/websocket": "^0.3.2",
- "@github/webauthn-json": "^0.4.2",
+ "@github/webauthn-json": "^0.5.4",
"@rails/ujs": "^6.0.3",
"array-includes": "^3.1.1",
+ "atrament": "0.2.4",
"arrow-key-navigation": "^1.2.0",
"autoprefixer": "^9.8.6",
- "axios": "^0.19.2",
+ "axios": "^0.20.0",
"babel-loader": "^8.1.0",
"babel-plugin-lodash": "^3.3.4",
"babel-plugin-preval": "^5.0.0",
"escape-html": "^1.0.3",
"exif-js": "^2.3.0",
"express": "^4.17.1",
- "file-loader": "^6.0.0",
+ "favico.js": "^0.3.10",
+ "file-loader": "^6.1.0",
"font-awesome": "^4.7.0",
"glob": "^7.1.6",
"history": "^4.10.1",
subject { Account.following_map(target_account_ids, account_id) }
context 'account with Follow' do
- it 'returns { target_account_id => true }' do
+ it 'returns { target_account_id => { reblogs: true } }' do
Fabricate(:follow, account: account, target_account: target_account)
- is_expected.to eq(target_account_id => { reblogs: true })
+ is_expected.to eq(target_account_id => { reblogs: true, notify: false })
end
end
recipient.suspend!
is_expected.to_not change(Notification, :count)
end
-
+
context 'for direct messages' do
let(:activity) { Fabricate(:mention, account: recipient, status: Fabricate(:status, account: sender, visibility: :direct)) }
+ let(:type) { :mention }
before do
user.settings.interactions = user.settings.interactions.merge('must_be_following_dm' => enabled)