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
b036a19c
Commit
b036a19c
authored
Jun 18, 2018
by
kaniini
Browse files
activity: add normalize() to find a complete activity given either URI or partial structure
parent
a2009432
Changes
1
Show whitespace changes
Inline
Side-by-side
lib/pleroma/activity.ex
View file @
b036a19c
...
...
@@ -78,4 +78,8 @@ def get_create_activity_by_object_ap_id(ap_id) when is_binary(ap_id) do
end
def
get_create_activity_by_object_ap_id
(
_
),
do
:
nil
def
normalize
(
obj
)
when
is_map
(
obj
),
do
:
Activity
.
get_by_ap_id
(
obj
[
"id"
])
def
normalize
(
ap_id
)
when
is_binary
(
ap_id
),
do
:
Activity
.
get_by_ap_id
(
ap_id
)
def
normalize
(
_
),
do
:
nil
end
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