Fix duplicate @doc entries
This commit is contained in:
parent
268f7f492a
commit
636c00037d
|
@ -242,9 +242,7 @@ def publish(%User{} = actor, %{data: %{"bcc" => bcc}} = activity)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
@doc """
|
# Publishes an activity to all relevant peers.
|
||||||
Publishes an activity to all relevant peers.
|
|
||||||
"""
|
|
||||||
def publish(%User{} = actor, %Activity{} = activity) do
|
def publish(%User{} = actor, %Activity{} = activity) do
|
||||||
public = is_public?(activity)
|
public = is_public?(activity)
|
||||||
|
|
||||||
|
|
|
@ -274,7 +274,7 @@ defp build_attachment_link(_), do: ""
|
||||||
def format_input(text, format, options \\ [])
|
def format_input(text, format, options \\ [])
|
||||||
|
|
||||||
@doc """
|
@doc """
|
||||||
Formatting text to plain text.
|
Formatting text to plain text, BBCode, HTML, or Markdown
|
||||||
"""
|
"""
|
||||||
def format_input(text, "text/plain", options) do
|
def format_input(text, "text/plain", options) do
|
||||||
text
|
text
|
||||||
|
@ -285,9 +285,6 @@ def format_input(text, "text/plain", options) do
|
||||||
end).()
|
end).()
|
||||||
end
|
end
|
||||||
|
|
||||||
@doc """
|
|
||||||
Formatting text as BBCode.
|
|
||||||
"""
|
|
||||||
def format_input(text, "text/bbcode", options) do
|
def format_input(text, "text/bbcode", options) do
|
||||||
text
|
text
|
||||||
|> String.replace(~r/\r/, "")
|
|> String.replace(~r/\r/, "")
|
||||||
|
@ -297,18 +294,12 @@ def format_input(text, "text/bbcode", options) do
|
||||||
|> Formatter.linkify(options)
|
|> Formatter.linkify(options)
|
||||||
end
|
end
|
||||||
|
|
||||||
@doc """
|
|
||||||
Formatting text to html.
|
|
||||||
"""
|
|
||||||
def format_input(text, "text/html", options) do
|
def format_input(text, "text/html", options) do
|
||||||
text
|
text
|
||||||
|> Formatter.html_escape("text/html")
|
|> Formatter.html_escape("text/html")
|
||||||
|> Formatter.linkify(options)
|
|> Formatter.linkify(options)
|
||||||
end
|
end
|
||||||
|
|
||||||
@doc """
|
|
||||||
Formatting text to markdown.
|
|
||||||
"""
|
|
||||||
def format_input(text, "text/markdown", options) do
|
def format_input(text, "text/markdown", options) do
|
||||||
text
|
text
|
||||||
|> Formatter.mentions_escape(options)
|
|> Formatter.mentions_escape(options)
|
||||||
|
|
|
@ -24,7 +24,7 @@ def login(%{assigns: %{user: %User{}}} = conn, _params) do
|
||||||
redirect(conn, to: local_mastodon_root_path(conn))
|
redirect(conn, to: local_mastodon_root_path(conn))
|
||||||
end
|
end
|
||||||
|
|
||||||
@doc "Local Mastodon FE login init action"
|
# Local Mastodon FE login init action
|
||||||
def login(conn, %{"code" => auth_token}) do
|
def login(conn, %{"code" => auth_token}) do
|
||||||
with {:ok, app} <- get_or_make_app(),
|
with {:ok, app} <- get_or_make_app(),
|
||||||
{:ok, auth} <- Authorization.get_by_token(app, auth_token),
|
{:ok, auth} <- Authorization.get_by_token(app, auth_token),
|
||||||
|
@ -35,7 +35,7 @@ def login(conn, %{"code" => auth_token}) do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@doc "Local Mastodon FE callback action"
|
# Local Mastodon FE callback action
|
||||||
def login(conn, _) do
|
def login(conn, _) do
|
||||||
with {:ok, app} <- get_or_make_app() do
|
with {:ok, app} <- get_or_make_app() do
|
||||||
path =
|
path =
|
||||||
|
|
|
@ -123,9 +123,8 @@ def index(%{assigns: %{user: user}} = conn, %{ids: ids} = _params) do
|
||||||
|
|
||||||
@doc """
|
@doc """
|
||||||
POST /api/v1/statuses
|
POST /api/v1/statuses
|
||||||
|
|
||||||
Creates a scheduled status when `scheduled_at` param is present and it's far enough
|
|
||||||
"""
|
"""
|
||||||
|
# Creates a scheduled status when `scheduled_at` param is present and it's far enough
|
||||||
def create(
|
def create(
|
||||||
%{
|
%{
|
||||||
assigns: %{user: user},
|
assigns: %{user: user},
|
||||||
|
@ -156,11 +155,8 @@ def create(
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@doc """
|
|
||||||
POST /api/v1/statuses
|
|
||||||
|
|
||||||
Creates a regular status
|
# Creates a regular status
|
||||||
"""
|
|
||||||
def create(%{assigns: %{user: user}, body_params: %{status: _} = params} = conn, _) do
|
def create(%{assigns: %{user: user}, body_params: %{status: _} = params} = conn, _) do
|
||||||
params = Map.put(params, :in_reply_to_status_id, params[:in_reply_to_id])
|
params = Map.put(params, :in_reply_to_status_id, params[:in_reply_to_id])
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue