Skip to content
Extraits de code Groupes Projets
Valider dce1531b rédigé par Ruxton's avatar Ruxton Validation de Jonne Haß
Parcourir les fichiers

Changed follow_diasporahq to be configurable to auto follow any user on join.

Fixing example config file

Updated changelog
parent 405622ba
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
* Admin: add option to find users under 13 (COPPA) [#4252](https://github.com/diaspora/diaspora/pull/4252) * Admin: add option to find users under 13 (COPPA) [#4252](https://github.com/diaspora/diaspora/pull/4252)
* Show the user if a contact is sharing with them when viewing their profile page [#2948](https://github.com/diaspora/diaspora/issues/2948) * Show the user if a contact is sharing with them when viewing their profile page [#2948](https://github.com/diaspora/diaspora/issues/2948)
* Made Unicorn timeout configurable and increased the default to 90 seconds * Made Unicorn timeout configurable and increased the default to 90 seconds
* Follow DiasporaHQ upon account creation is now configurable to another account [#4278](https://github.com/diaspora/diaspora/pull/4278)
# 0.1.1.0 # 0.1.1.0
......
...@@ -391,8 +391,8 @@ class User < ActiveRecord::Base ...@@ -391,8 +391,8 @@ class User < ActiveRecord::Base
self.aspects.create(:name => I18n.t('aspects.seed.work')) self.aspects.create(:name => I18n.t('aspects.seed.work'))
aq = self.aspects.create(:name => I18n.t('aspects.seed.acquaintances')) aq = self.aspects.create(:name => I18n.t('aspects.seed.acquaintances'))
if AppConfig.settings.follow_diasporahq? if AppConfig.settings.autofollow_on_join?
default_account = Webfinger.new('diasporahq@joindiaspora.com').fetch default_account = Webfinger.new(AppConfig.settings.autofollow_on_join_user).fetch
self.share_with(default_account, aq) if default_account self.share_with(default_account, aq) if default_account
end end
aq aq
......
...@@ -53,7 +53,8 @@ defaults: ...@@ -53,7 +53,8 @@ defaults:
settings: settings:
pod_name: 'Diaspora*' pod_name: 'Diaspora*'
enable_registrations: true enable_registrations: true
follow_diasporahq: true autofollow_on_join: true
autofollow_on_join_user: 'diasporahq@joindiaspora.com'
invitations: invitations:
open: true open: true
count: 25 count: 25
...@@ -121,7 +122,8 @@ development: ...@@ -121,7 +122,8 @@ development:
server: server:
unicorn_worker: 1 unicorn_worker: 1
settings: settings:
follow_diasporahq: false autofollow_on_join: false
autofollow_on_join_user: ''
production: production:
i_am_a_dummy: # Remove if you add an actual override i_am_a_dummy: # Remove if you add an actual override
test: test:
...@@ -132,7 +134,8 @@ test: ...@@ -132,7 +134,8 @@ test:
assets: assets:
serve: true serve: true
settings: settings:
follow_diasporahq: false autofollow_on_join: false
autofollow_on_join_user: ''
invitations: invitations:
open: true open: true
services: services:
......
...@@ -205,12 +205,16 @@ configuration: ## Section ...@@ -205,12 +205,16 @@ configuration: ## Section
## the first registration (you). ## the first registration (you).
#enable_registrations: true #enable_registrations: true
## Set this to false if you don't want your users to follow the ## Users will automatically follow a specified account on creation
## diasporahq@joindiaspora.com account on account creation. ## Set this to false if you don't want your users to automatically
## follow an account upon creation.
#autfollow_on_join: true
## The diasporahq account helps users start with some activity in ## The diasporahq account helps users start with some activity in
## their stream and get news about Diaspora, but if you don't want ## their stream and get news about Diaspora, but if you don't want
## your server to contact joindiaspora.com, set this to false: ## your server to contact joindiaspora.com, you can change account
#follow_diasporahq: false ## below or set autofollow_on_join to false
#autofollow_on_join_user: 'diasporahq@joindiaspora.com'
## Settings about invitations ## Settings about invitations
invitations: ## Section invitations: ## Section
......
...@@ -864,26 +864,29 @@ describe User do ...@@ -864,26 +864,29 @@ describe User do
end end
end end
describe "diasporahq sharing" do describe "autofollow sharing" do
let(:user) { let(:user) {
FactoryGirl.create(:user) FactoryGirl.create(:user)
} }
before(:each) do before(:each) do
@old_followhq_value = AppConfig.settings.follow_diasporahq? @old_autofollow_value = AppConfig.settings.autofollow_on_join?
@old_autofollow_user = AppConfig.settings.autofollow_on_join_user
end end
after(:each) do after(:each) do
AppConfig.settings.follow_diasporahq = @old_followhq_value AppConfig.settings.autofollow_on_join = @old_followhq_value
AppConfig.settings.autofollow_on_join_user = @old_autofollow_user
end end
context "with sharing with diasporahq enabled" do context "with autofollow sharing enabled" do
it "should start sharing with the diasporahq account" do it "should start sharing with autofollow account" do
AppConfig.settings.follow_diasporahq = true AppConfig.settings.autofollow_on_join = true
AppConfig.settings.autofollow_on_join_user = 'one'
wf_mock = mock wf_mock = mock
wf_mock.should_receive(:fetch) wf_mock.should_receive(:fetch)
Webfinger.should_receive(:new).and_return(wf_mock) Webfinger.should_receive(:new).with('one').and_return(wf_mock)
user.seed_aspects user.seed_aspects
end end
...@@ -891,7 +894,7 @@ describe User do ...@@ -891,7 +894,7 @@ describe User do
context "with sharing with diasporahq enabled" do context "with sharing with diasporahq enabled" do
it "should not start sharing with the diasporahq account" do it "should not start sharing with the diasporahq account" do
AppConfig.settings.follow_diasporahq = false AppConfig.settings.autofollow_on_join = false
Webfinger.should_not_receive(:new) Webfinger.should_not_receive(:new)
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter