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
01faa7c5
Commit
01faa7c5
authored
Feb 19, 2018
by
lain
Browse files
TwitterAPI: support follow activities without published date.
parent
1633470e
Pipeline
#758
failed with stage
in 3 minutes and 1 second
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
lib/pleroma/web/twitter_api/representers/activity_representer.ex
View file @
01faa7c5
...
...
@@ -56,7 +56,8 @@ def to_map(%Activity{data: %{"type" => "Like", "published" => created_at}} = act
}
end
def
to_map
(%
Activity
{
data:
%{
"type"
=>
"Follow"
,
"published"
=>
created_at
,
"object"
=>
followed_id
}}
=
activity
,
%{
user:
user
}
=
opts
)
do
def
to_map
(%
Activity
{
data:
%{
"type"
=>
"Follow"
,
"object"
=>
followed_id
}}
=
activity
,
%{
user:
user
}
=
opts
)
do
created_at
=
activity
.
data
[
"published"
]
||
(
DateTime
.
to_iso8601
(
activity
.
inserted_at
))
created_at
=
created_at
|>
Utils
.
date_to_asctime
followed
=
User
.
get_cached_by_ap_id
(
followed_id
)
...
...
Write
Preview
Markdown
is supported
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