Skip to content
Extraits de code Groupes Projets
Valider 2d6a69cd rédigé par Maxwell Salzberg's avatar Maxwell Salzberg
Parcourir les fichiers

fix for 500s in liked emails for reshares and activity streams photos

parent 685165d1
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
class Notifier < ActionMailer::Base
helper :application
helper :markdownify
helper :notifier
default :from => AppConfig[:smtp_sender_address]
......@@ -80,6 +81,7 @@ class Notifier < ActionMailer::Base
@receiver = User.find_by_id(recipient_id)
@sender = Person.find_by_id(sender_id)
@comment = Comment.find_by_id(comment_id)
@post_author_name = @comment.post.author.name
......@@ -123,6 +125,7 @@ class Notifier < ActionMailer::Base
end
end
private
def log_mail recipient_id, sender_id, type
log_string = "event=mail mail_type=#{type} recipient_id=#{recipient_id} sender_id=#{sender_id}"
......
......@@ -2,7 +2,7 @@
= "#{t('.liked', :name => "#{@sender.name}")}:"
%p{:style => "font-style:italic;color:#666"}
= process_newlines(truncate(@like.target.formatted_message(:plain_text => true), :length => 200))
= post_message(@like.target, :process_newlines => true)
%p
= link_to t('.view_post'), post_url(@like.target)
!= "#{t('notifier.liked.liked', :name => "#{@sender.name}")}:"
!= truncate(@like.target.formatted_message(:plain_text => true), :length => 200)
!=post_message(@like.target)
......@@ -421,6 +421,7 @@ en:
other: "%{count} new notifications"
notifier:
a_post_you_shared: "a post."
email_sent_by_diaspora: "This email was sent by Diaspora. If you'd like to stop getting emails like this,"
click_here: "click here"
hello: "Hello %{name}!"
......
......@@ -115,6 +115,19 @@ describe Notifier do
it 'should not include translation missing' do
@mail.body.encoded.should_not include("missing")
end
it 'can handle a reshare' do
reshare = Factory(:reshare)
like = reshare.likes.create!(:author => bob.person)
mail = Notifier.liked(alice.id, like.author.id, like.id)
end
it 'can handle a activity streams photo' do
puts "boner"
reshare = Factory(:activity_streams_photo)
like = reshare.likes.create!(:author => bob.person)
mail = Notifier.liked(alice.id, like.author.id, like.id)
end
end
describe ".private_message" do
......
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