Unverified Commit d9841786 authored by Benjamin Neff's avatar Benjamin Neff

Merge pull request #7327 from svbergerem/display-mentions-in-comment

Render mentions as links in comments
parents 3ef98f50 ef3faff8
......@@ -10,6 +10,7 @@
## Features
* Add support for mentions in comments to the backend [#6818](https://github.com/diaspora/diaspora/pull/6818)
* Add support for new mention syntax [#7300](https://github.com/diaspora/diaspora/pull/7300)
* Render mentions as links in comments [#7327](https://github.com/diaspora/diaspora/pull/7327)
......@@ -20,7 +20,7 @@ app.views.Comment = app.views.Content.extend({
presenter : function() {
return _.extend(this.defaultPresenter(), {
canRemove: this.canRemove(),
text : app.helpers.textFormatter(this.model.get("text"))
text: app.helpers.textFormatter(this.model.get("text"), this.model.get("mentioned_people"))
......@@ -5,11 +5,12 @@ class CommentPresenter < BasePresenter
def as_json(opts={})
:id => @comment.id,
:guid => @comment.guid,
:text => @comment.message.plain_text_for_json,
:author => @comment.author.as_api_response(:backbone),
:created_at => @comment.created_at
id: @comment.id,
guid: @comment.guid,
text: @comment.message.plain_text_for_json,
author: @comment.author.as_api_response(:backbone),
created_at: @comment.created_at,
mentioned_people: @comment.mentioned_people.as_api_response(:backbone)
......@@ -54,3 +54,15 @@ Feature: Mentions
Then I should see "Bob Jones" within ".stream-element"
When I follow "Bob Jones"
Then I should see "Bob Jones"
Scenario: A user mentions another user in a comment and it displays correctly
Given following users exist:
| username | email |
| Bob Jones | bob@bob.bob |
| Alice Smith | alice@alice.alice |
And a user with email "bob@bob.bob" is connected with "alice@alice.alice"
And "alice@alice.alice" has a public post with text "check this out!"
And "alice@alice.alice" has commented mentioning "bob@bob.bob" on "check this out!"
When I sign in as "alice@alice.alice"
And I follow "Bob Jones"
Then I should see "Bob Jones"
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