diff --git a/Changelog.md b/Changelog.md index 14cfb2502..8f49e58ba 100644 --- a/Changelog.md +++ b/Changelog.md @@ -38,6 +38,7 @@ Note: Although this is a minor release, the configuration file changed because t * Add number of unreviewed reports to admin dashboard and admin sidebar [#7109](https://github.com/diaspora/diaspora/pull/7109) * Don't federate to pods that have been offline for an extended period of time [#7120](https://github.com/diaspora/diaspora/pull/7120) * Add In-Reply-To and References headers to notification mails [#7122](https://github.com/diaspora/diaspora/pull/7122) +* Directly link to a comment in commented notification mails [#7124](https://github.com/diaspora/diaspora/pull/7124) # 0.6.0.1 diff --git a/app/views/notifier/also_commented.markerb b/app/views/notifier/also_commented.markerb index 255978ef7..8c5023664 100644 --- a/app/views/notifier/also_commented.markerb +++ b/app/views/notifier/also_commented.markerb @@ -2,4 +2,4 @@ [<%= t('notifier.comment_on_post.reply', :name => @notification.comment_post.author_first_name) %>][1] -[1]: <%= post_url(@notification.comment_post) %> +[1]: <%= post_url(@notification.comment_post, anchor: @notification.comment.guid) %> diff --git a/app/views/notifier/comment_on_post.markerb b/app/views/notifier/comment_on_post.markerb index aef5d049f..7d4d86802 100644 --- a/app/views/notifier/comment_on_post.markerb +++ b/app/views/notifier/comment_on_post.markerb @@ -2,4 +2,4 @@ [<%= t('notifier.comment_on_post.reply', :name => @notification.comment.parent_author_name) %>][1] -[1]: <%= post_url(@notification.comment.post) %> +[1]: <%= post_url(@notification.comment.post, anchor: @notification.comment.guid) %> diff --git a/spec/mailers/notifier_spec.rb b/spec/mailers/notifier_spec.rb index f56b27c00..6551b9f9c 100644 --- a/spec/mailers/notifier_spec.rb +++ b/spec/mailers/notifier_spec.rb @@ -269,8 +269,8 @@ describe Notifier, type: :mailer do expect(comment_mail.body.encoded).to include(comment.text) end - it "contains the original post's link" do - expect(comment_mail.body.encoded.include?("#{comment.post.id}")).to be true + it "contains the original post's link with comment anchor" do + expect(comment_mail.body.encoded).to include("#{comment.post.id}##{comment.guid}") end it "should not include translation fallback" do @@ -315,8 +315,8 @@ describe Notifier, type: :mailer do expect(comment_mail.body.encoded).to include(comment.text) end - it "contains the original post's link" do - expect(comment_mail.body.encoded).to include("#{comment.post.id}") + it "contains the original post's link with comment anchor" do + expect(comment_mail.body.encoded).to include("#{comment.post.id}##{comment.guid}") end it "should not include translation fallback" do