@@ -21,7 +21,7 @@ defmodule Mobilizon.GraphQL.API.Utils do
|
||||
text
|
||||
|> Formatter.html_escape("text/plain")
|
||||
|> Formatter.linkify(options)
|
||||
|> (fn {text, mentions, tags} -> {String.replace(text, ~r/\r?\n/, "<br>"), mentions, tags} end).()
|
||||
|> inject_new_lines()
|
||||
end
|
||||
|
||||
def format_input(text, "text/html", options) do
|
||||
@@ -30,6 +30,10 @@ defmodule Mobilizon.GraphQL.API.Utils do
|
||||
|> Formatter.linkify(options)
|
||||
end
|
||||
|
||||
defp inject_new_lines({text, mentions, tags}) do
|
||||
{String.replace(text, ~r/\r?\n/, "<br>"), mentions, tags}
|
||||
end
|
||||
|
||||
@doc """
|
||||
Use the data-media-id attributes to extract media from body text
|
||||
"""
|
||||
|
||||
@@ -15,7 +15,7 @@ defmodule Mobilizon.GraphQL.Resolvers.Media do
|
||||
See Mobilizon.Web.Resolvers.Event.create_event/3
|
||||
"""
|
||||
def media(%{picture_id: media_id} = _parent, _args, _resolution) do
|
||||
with {:ok, media} <- do_fetch_media(media_id), do: {:ok, media}
|
||||
do_fetch_media(media_id)
|
||||
end
|
||||
|
||||
def media(%{picture: media} = _parent, _args, _resolution), do: {:ok, media}
|
||||
|
||||
@@ -559,11 +559,9 @@ defmodule Mobilizon.GraphQL.Resolvers.User do
|
||||
Enum.each(actors, fn actor ->
|
||||
actor_performing = Keyword.get(options, :actor_performing, actor)
|
||||
Actions.Delete.delete(actor, actor_performing, true)
|
||||
end),
|
||||
# Delete user
|
||||
{:ok, user} <-
|
||||
Users.delete_user(user, reserve_email: Keyword.get(options, :reserve_email, activated)) do
|
||||
{:ok, user}
|
||||
end) do
|
||||
# Delete user
|
||||
Users.delete_user(user, reserve_email: Keyword.get(options, :reserve_email, activated))
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user