projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'develop' into feature/disable-account
[akkoma]
/
lib
/
pleroma
/
web
/
common_api
/
utils.ex
diff --git
a/lib/pleroma/web/common_api/utils.ex
b/lib/pleroma/web/common_api/utils.ex
index 7b9f0ea06d5bbb7014273f3ed6883e625e841dbc..887f878c440ed2a6e6550017596c3f3764d1db12 100644
(file)
--- a/
lib/pleroma/web/common_api/utils.ex
+++ b/
lib/pleroma/web/common_api/utils.ex
@@
-195,11
+195,10
@@
defmodule Pleroma.Web.CommonAPI.Utils do
Formatting text to markdown.
"""
def format_input(text, "text/markdown", options) do
Formatting text to markdown.
"""
def format_input(text, "text/markdown", options) do
- options = Keyword.put(options, :mentions_escape, true)
-
text
text
+ |> Formatter.mentions_escape(options)
+ |> Earmark.as_html!()
|> Formatter.linkify(options)
|> Formatter.linkify(options)
- |> (fn {text, mentions, tags} -> {Earmark.as_html!(text), mentions, tags} end).()
|> Formatter.html_escape("text/html")
end
|> Formatter.html_escape("text/html")
end
@@
-209,7
+208,7
@@
defmodule Pleroma.Web.CommonAPI.Utils do
context,
content_html,
attachments,
context,
content_html,
attachments,
- in
ReplyT
o,
+ in
_reply_t
o,
tags,
cw \\ nil,
cc \\ []
tags,
cw \\ nil,
cc \\ []
@@
-226,10
+225,11
@@
defmodule Pleroma.Web.CommonAPI.Utils do
"tag" => tags |> Enum.map(fn {_, tag} -> tag end) |> Enum.uniq()
}
"tag" => tags |> Enum.map(fn {_, tag} -> tag end) |> Enum.uniq()
}
- if inReplyTo do
+ if in_reply_to do
+ in_reply_to_object = Object.normalize(in_reply_to)
+
object
object
- |> Map.put("inReplyTo", inReplyTo.data["object"]["id"])
- |> Map.put("inReplyToStatusId", inReplyTo.id)
+ |> Map.put("inReplyTo", in_reply_to_object.data["id"])
else
object
end
else
object
end
@@
-284,7
+284,7
@@
defmodule Pleroma.Web.CommonAPI.Utils do
end
def confirm_current_password(user, password) do
end
def confirm_current_password(user, password) do
- with %User{local: true} = db_user <- User.get_by_id(user.id),
+ with %User{local: true} = db_user <- User.get_
cached_
by_id(user.id),
true <- Pbkdf2.checkpw(password, db_user.password_hash) do
{:ok, db_user}
else
true <- Pbkdf2.checkpw(password, db_user.password_hash) do
{:ok, db_user}
else