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
9afc6720
Commit
9afc6720
authored
Apr 21, 2017
by
lain
Browse files
Quick fix for activities without 'to'.
parent
1e88f102
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/pleroma/web/twitter_api/twitter_api.ex
View file @
9afc6720
...
...
@@ -318,7 +318,7 @@ defp activity_to_status(activity, opts) do
actor
=
get_in
(
activity
.
data
,
[
"actor"
])
user
=
User
.
get_cached_by_ap_id
(
actor
)
# mentioned_users = Repo.all(from user in User, where: user.ap_id in ^activity.data["to"])
mentioned_users
=
Enum
.
map
(
activity
.
data
[
"to"
],
fn
(
ap_id
)
->
mentioned_users
=
Enum
.
map
(
activity
.
data
[
"to"
]
||
[]
,
fn
(
ap_id
)
->
User
.
get_cached_by_ap_id
(
ap_id
)
end
)
|>
Enum
.
filter
(
&
(
&1
))
...
...
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