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
1bbc701a
Verified
Commit
1bbc701a
authored
Jan 24, 2022
by
Alex Gleason
Browse files
ForceMentionsInContent: use `to` instead of `tag`
parent
19d557c8
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/pleroma/web/activity_pub/mrf/force_mentions_in_content.ex
View file @
1bbc701a
...
...
@@ -35,15 +35,12 @@ defp extract_mention_uris_from_content(content) do
end
@impl
true
def
filter
(%{
"type"
=>
"Create"
,
"object"
=>
%{
"type"
=>
"Note"
,
"t
ag
"
=>
t
ag
}}
=
object
)
do
def
filter
(%{
"type"
=>
"Create"
,
"object"
=>
%{
"type"
=>
"Note"
,
"t
o
"
=>
t
o
}}
=
object
)
do
# image-only posts from pleroma apparently reach this MRF without the content field
content
=
object
[
"object"
][
"content"
]
||
""
mention_users
=
tag
|>
Enum
.
filter
(
fn
tag
->
tag
[
"type"
]
==
"Mention"
end
)
|>
Enum
.
map
(
&
&1
[
"href"
])
|>
Enum
.
reject
(
&
is_nil
/
1
)
to
|>
Enum
.
map
(
fn
ap_id_or_uri
->
case
User
.
get_or_fetch_by_ap_id
(
ap_id_or_uri
)
do
{
:ok
,
user
}
->
{
ap_id_or_uri
,
user
}
...
...
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