ソースを参照

Instead of refusing to create accounts, domain blocks auto-suspend new accounts from that domain

master
Eugen Rochko 7年前
コミット
9bd3b11cfb
4個のファイルの変更6行の追加3行の削除
  1. +3
    -0
      app/assets/javascripts/components/store/configureStore.jsx
  2. +1
    -1
      app/services/follow_remote_account_service.rb
  3. +1
    -1
      app/services/process_feed_service.rb
  4. +1
    -1
      app/services/update_remote_profile_service.rb

+ 3
- 0
app/assets/javascripts/components/store/configureStore.jsx ファイルの表示

@@ -4,8 +4,11 @@ import appReducer from '../reducers';
import loadingBarMiddleware from '../middleware/loading_bar';
import errorsMiddleware from '../middleware/errors';
import soundsMiddleware from 'redux-sounds';
import Howler from 'howler';
import Immutable from 'immutable';

Howler.mobileAutoEnable = false;

const soundsData = {
boop: '/sounds/boop.mp3'
};


+ 1
- 1
app/services/follow_remote_account_service.rb ファイルの表示

@@ -14,7 +14,6 @@ class FollowRemoteAccountService < BaseService
username, domain = uri.split('@')

return Account.find_local(username) if TagManager.instance.local_domain?(domain)
return nil if DomainBlock.blocked?(domain)

account = Account.find_remote(username, domain)
return account unless account.nil?
@@ -41,6 +40,7 @@ class FollowRemoteAccountService < BaseService
account.url = data.link('http://webfinger.net/rel/profile-page').href
account.public_key = magic_key_to_pem(data.link('magic-public-key').href)
account.private_key = nil
account.suspended = true if DomainBlock.blocked?(domain)

xml = get_feed(account.remote_url)
hubs = get_hubs(xml)


+ 1
- 1
app/services/process_feed_service.rb ファイルの表示

@@ -61,7 +61,7 @@ class ProcessFeedService < BaseService
status.save!

NotifyService.new.call(status.reblog.account, status) if status.reblog? && status.reblog.account.local?
LinkCrawlWorker.perform_async(status.reblog? ? status.reblog_of_id : status.id)
# LinkCrawlWorker.perform_async(status.reblog? ? status.reblog_of_id : status.id)
Rails.logger.debug "Queuing remote status #{status.id} (#{id}) for distribution"
DistributionWorker.perform_async(status.id)
status


+ 1
- 1
app/services/update_remote_profile_service.rb ファイルの表示

@@ -10,7 +10,7 @@ class UpdateRemoteProfileService < BaseService
unless author_xml.nil?
account.display_name = author_xml.at_xpath('./poco:displayName', poco: TagManager::POCO_XMLNS).content unless author_xml.at_xpath('./poco:displayName', poco: TagManager::POCO_XMLNS).nil?
account.note = author_xml.at_xpath('./poco:note', poco: TagManager::POCO_XMLNS).content unless author_xml.at_xpath('./poco:note', poco: TagManager::POCO_XMLNS).nil?
account.avatar_remote_url = author_xml.at_xpath('./xmlns:link[@rel="avatar"]', xmlns: TagManager::XMLNS)['href'] unless author_xml.at_xpath('./xmlns:link[@rel="avatar"]', xmlns: TagManager::XMLNS).nil? || author_xml.at_xpath('./xmlns:link[@rel="avatar"]', xmlns: TagManager::XMLNS)['href'].blank?
account.avatar_remote_url = author_xml.at_xpath('./xmlns:link[@rel="avatar"]', xmlns: TagManager::XMLNS)['href'] unless author_xml.at_xpath('./xmlns:link[@rel="avatar"]', xmlns: TagManager::XMLNS).nil? || author_xml.at_xpath('./xmlns:link[@rel="avatar"]', xmlns: TagManager::XMLNS)['href'].blank? || account.suspended?
end

old_hub_url = account.hub_url


読み込み中…
キャンセル
保存