Fix things with in_reply_to_comment_id

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2018-11-08 15:57:46 +01:00
parent 537736a98e
commit 04e342c897
3 changed files with 30 additions and 3 deletions

View File

@@ -40,4 +40,11 @@ defmodule Mobilizon.Events.Comment do
|> put_change(:url, url)
|> validate_required([:text, :actor_id, :url])
end
@doc """
Returns the id of the first comment in the conversation
"""
def get_thread_id(%Comment{id: id, origin_comment_id: origin_comment_id}) do
origin_comment_id || id
end
end