Refactor adding tags to an event
Also refactor extracting tags from content, now uses Pleroma's Formatter Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -4,10 +4,9 @@ defmodule MobilizonWeb.API.Groups do
|
||||
"""
|
||||
alias Mobilizon.Actors
|
||||
alias Mobilizon.Actors.Actor
|
||||
alias Mobilizon.Service.Formatter
|
||||
alias Mobilizon.Service.ActivityPub
|
||||
alias Mobilizon.Service.ActivityPub.Utils, as: ActivityPubUtils
|
||||
import MobilizonWeb.API.Utils
|
||||
alias MobilizonWeb.API.Utils
|
||||
|
||||
@doc """
|
||||
Create a group
|
||||
@@ -24,17 +23,9 @@ defmodule MobilizonWeb.API.Groups do
|
||||
{:bad_actor, Actors.get_local_actor_by_name(admin_actor_username)},
|
||||
{:existing_group, nil} <- {:existing_group, Actors.get_group_by_title(title)},
|
||||
title <- String.trim(title),
|
||||
mentions <- Formatter.parse_mentions(description),
|
||||
visibility <- Map.get(args, :visibility, "public"),
|
||||
{to, cc} <- to_for_actor_and_mentions(actor, mentions, nil, visibility),
|
||||
tags <- Formatter.parse_tags(description),
|
||||
content_html <-
|
||||
make_content_html(
|
||||
description,
|
||||
mentions,
|
||||
tags,
|
||||
"text/plain"
|
||||
),
|
||||
visibility <- Map.get(args, :visibility, :public),
|
||||
{content_html, tags, to, cc} <-
|
||||
Utils.prepare_content(actor, description, visibility, [], nil),
|
||||
group <-
|
||||
ActivityPubUtils.make_group_data(
|
||||
url,
|
||||
|
||||
Reference in New Issue
Block a user