Commit 4b841ef0 authored by Jonne Haß's avatar Jonne Haß

Merge pull request #5843 from margori/private_post_subject_content

Limited post content excluded from subject of comment email
parents cc5bd16e aa6b590b
......@@ -7,6 +7,7 @@
* Fix only sharing flag for contacts that are receiving [#5848](https://github.com/diaspora/diaspora/pull/5848)
## Features
* Hide post title of limited post in comment notification email [#5843](https://github.com/diaspora/diaspora/pull/5843)
# 0.5.0.0
......
......@@ -6,7 +6,11 @@ module NotificationMailers
@comment = Comment.find(comment_id)
@headers[:from] = "\"#{@comment.author_name} (diaspora*)\" <#{AppConfig.mail.sender_address}>"
@headers[:subject] = "Re: #{@comment.comment_email_subject}"
if @comment.public?
@headers[:subject] = "Re: #{@comment.comment_email_subject}"
else
@headers[:subject] = I18n.t("notifier.comment_on_post.limited_subject")
end
end
end
end
......@@ -743,6 +743,7 @@ en:
sharing: "has started sharing with you!"
view_profile: "View %{name}’s profile"
comment_on_post:
limited_subject: "There's a new comment on a post you commented"
reply: "Reply or view %{name}’s post >"
mentioned:
subject: "%{name} has mentioned you on diaspora*"
......
......@@ -318,6 +318,26 @@ describe Notifier, :type => :mailer do
end
end
context "limited comments" do
let(:commented_limited_post) {
bob.post(:status_message, to: :all, public: false,
text: "### Limited headline \r\n It's **really** sunny outside today")
}
let(:limited_comment) { eve.comment!(commented_limited_post, "Totally is") }
describe ".comment_on_limited_post" do
let(:limited_comment_mail) { Notifier.comment_on_post(bob.id, person.id, limited_comment.id).deliver_now }
it "SUBJECT: does not show limited message" do
expect(limited_comment_mail.subject).not_to include("Limited headline")
end
it "BODY: does not show limited message" do
expect(limited_comment_mail.body.encoded).not_to include("Limited headline")
end
end
end
describe 'hashtags' do
it 'escapes hashtags' do
mails = Notifier.admin("#Welcome to bureaucracy!", [bob])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment