debianize-mobilizon/lib/mobilizon_web/api/comments.ex
Thomas Citharel cc820d6b63
Refactor Core things, including Ecto handling, ActivityPub & Transmogrifier modules
* Data doesn't need anymore to be converted to ActivityStream format to
be saved (this was taken from Pleroma and not at all a good idea here)
* Everything saved when creating an event is inserted into PostgreSQL in
a single transaction
2019-10-31 10:06:11 +01:00

20 lines
454 B
Elixir

defmodule MobilizonWeb.API.Comments do
@moduledoc """
API for Comments.
"""
alias Mobilizon.Events.Comment
alias Mobilizon.Service.ActivityPub
alias Mobilizon.Service.ActivityPub.Activity
@doc """
Create a comment
Creates a comment from an actor and a status
"""
@spec create_comment(map()) ::
{:ok, Activity.t(), Comment.t()} | any()
def create_comment(args) do
ActivityPub.create(:comment, args, true)
end
end