Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pleroma
pleroma
Commits
ed8dfa30
Verified
Commit
ed8dfa30
authored
Sep 26, 2018
by
kaniini
Committed by
Haelwenn
Sep 27, 2018
Browse files
transmogrifier: reformat `cond` block by hand
parent
eebe33e8
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/pleroma/web/activity_pub/transmogrifier.ex
View file @
ed8dfa30
...
...
@@ -100,11 +100,18 @@ def fix_in_reply_to(%{"inReplyTo" => in_reply_to} = object)
when
not
is_nil
(
in_reply_to
)
do
in_reply_to_id
=
cond
do
is_bitstring
(
in_reply_to
)
->
in_reply_to
is_map
(
in_reply_to
)
&&
is_bitstring
(
in_reply_to
[
"id"
])
->
in_reply_to
[
"id"
]
is_list
(
in_reply_to
)
&&
is_bitstring
(
Enum
.
at
(
in_reply_to
,
0
))
->
Enum
.
at
(
in_reply_to
,
0
)
is_bitstring
(
in_reply_to
)
->
in_reply_to
is_map
(
in_reply_to
)
&&
is_bitstring
(
in_reply_to
[
"id"
])
->
in_reply_to
[
"id"
]
is_list
(
in_reply_to
)
&&
is_bitstring
(
Enum
.
at
(
in_reply_to
,
0
))
->
Enum
.
at
(
in_reply_to
,
0
)
# Maybe I should output an error too?
true
->
""
true
->
""
end
case
ActivityPub
.
fetch_object_from_id
(
in_reply_to_id
)
do
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment