New generate config task from Pleroma upstream & move tasks namespace

Little fixes and tests

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2019-01-03 11:34:31 +01:00
parent 6885c73aa8
commit 8d943f950f
10 changed files with 229 additions and 149 deletions

View File

@@ -18,7 +18,8 @@ defmodule MobilizonWeb.API.Comments do
"""
@spec create_comment(String.t(), String.t(), String.t()) :: {:ok, Activity.t()} | any()
def create_comment(from_username, status, visibility \\ "public", inReplyToCommentURL \\ nil) do
with %Actor{url: url} = actor <- Actors.get_local_actor_by_name(from_username),
with {:local_actor, %Actor{url: url} = actor} <-
{:local_actor, Actors.get_local_actor_by_name(from_username)},
status <- String.trim(status),
mentions <- Formatter.parse_mentions(status),
inReplyToComment <- get_in_reply_to_comment(inReplyToCommentURL),