Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/diaspora/diaspora.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzhitomirskiyi <ilya@joindiaspora.com>2010-10-27 04:46:19 +0400
committerzhitomirskiyi <ilya@joindiaspora.com>2010-10-27 04:46:19 +0400
commit0b2e00b7d6d6dd87a590100e3e19541f180b8fa1 (patch)
tree4edb568d1ff1031ae20367a833117f1d5789757f
parentfa484e95e450c3d33b659e7a8221cf3b36a322eb (diff)
MS IZ the mailer will not be setup unless turned on in the APP_CONFIG
-rw-r--r--config/app_config.yml.example1
-rw-r--r--config/environments/development.rb2
-rw-r--r--config/environments/production.rb12
-rw-r--r--config/initializers/mailer_config.rb2
-rw-r--r--lib/diaspora/user/friending.rb4
5 files changed, 5 insertions, 16 deletions
diff --git a/config/app_config.yml.example b/config/app_config.yml.example
index 00dcb0b5f..a52ca2165 100644
--- a/config/app_config.yml.example
+++ b/config/app_config.yml.example
@@ -13,6 +13,7 @@ default:
pubsub_server: 'https://pubsubhubbub.appspot.com/'
mongo_host: 'localhost'
mongo_port: 27017
+ mailer_on: false
smtp_address: 'smtp.example.com'
smtp_port: '587'
smtp_domain: 'mail.example.com'
diff --git a/config/environments/development.rb b/config/environments/development.rb
index 80022947e..74a062ea5 100644
--- a/config/environments/development.rb
+++ b/config/environments/development.rb
@@ -20,7 +20,7 @@ Diaspora::Application.configure do
config.action_controller.perform_caching = false
# Don't care if the mailer can't send
- config.action_mailer.raise_delivery_errors = true
+ config.action_mailer.raise_delivery_errors = false
config.active_support.deprecation = :log
config.middleware.use MongoMapper::ClearDevMemory
#config.threadsafe!
diff --git a/config/environments/production.rb b/config/environments/production.rb
index eebcc420b..8c65da341 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -47,16 +47,4 @@ Diaspora::Application.configure do
# the I18n.default_locale when a translation can not be found)
config.i18n.fallbacks = true
config.threadsafe!
-
- config.action_mailer.delivery_method = :smtp
- config.action_mailer.default_url_options = {:host => 'pivots.joindiaspora.com'}
- config.action_mailer.smtp_settings = {
- :address => 'smtp.gmail.com',
- :port => 587,
- :domain => 'mail.joindiaspora.com',
- :authentication => 'plain',
- :user_name => 'diaspora-pivots@joindiaspora.com',
- :password => "xy289|]G+R*-kA",
- :enable_starttls_auto => true
- }
end
diff --git a/config/initializers/mailer_config.rb b/config/initializers/mailer_config.rb
index cbc5f7330..b334cdb42 100644
--- a/config/initializers/mailer_config.rb
+++ b/config/initializers/mailer_config.rb
@@ -4,7 +4,7 @@
Diaspora::Application.configure do
config.action_mailer.default_url_options = {:host => APP_CONFIG[:terse_pod_url]}
- unless Rails.env == 'test'
+ unless Rails.env == 'test' || APP_CONFIG[:mailer_on] != true
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:address => APP_CONFIG[:smtp_address],
diff --git a/lib/diaspora/user/friending.rb b/lib/diaspora/user/friending.rb
index ba76f4bde..653097042 100644
--- a/lib/diaspora/user/friending.rb
+++ b/lib/diaspora/user/friending.rb
@@ -71,14 +71,14 @@ module Diaspora
Rails.logger.info("#{self.real_name}'s friend request has been accepted")
friend_request.destroy
- #Notifier.request_accepted(self, friend_request.person, aspect).deliver
+ Notifier.request_accepted(self, friend_request.person, aspect).deliver
#this is a new friend request
else
self.pending_requests << friend_request
self.save
Rails.logger.info("#{self.real_name} has received a friend request")
friend_request.save
- #Notifier.new_request(self, friend_request.person).deliver
+ Notifier.new_request(self, friend_request.person).deliver
end
end