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
9a0163db
Commit
9a0163db
authored
Dec 29, 2018
by
Rin Toshaka
Browse files
use Kernel.put_in instead of Map.merge
parent
19f9889f
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/pleroma/web/common_api/utils.ex
View file @
9a0163db
...
...
@@ -300,17 +300,19 @@ def get_scrubbed_html(
if
!
(
new_scrubber_cache
==
scrubber_cache
)
or
scrubbed_html
==
nil
do
scrubbed_html
=
HTML
.
filter_tags
(
content
,
scrubbers
)
new_scrubber_cache
=
[%{
:scrubbers
=>
key
,
:content
=>
scrubbed_html
}
|
new_scrubber_cache
]
IO
.
puts
(
activity
)
activity
=
Map
.
merge
(
activity
,
%{
data:
%{
"object"
=>
%{
"scrubber_cache"
=>
new_scrubber_cache
}}
})
Map
.
put
(
activity
,
:data
,
Kernel
.
put_in
(
activity
.
data
,
[
"object"
,
"scrubber_cache"
],
new_scrubber_cache
)
)
cng
=
Ecto
.
Changeset
.
change
(
activity
)
Repo
.
update
(
cng
)
scrubbed_html
else
IO
.
puts
(
"got the post from cache"
)
scrubbed_html
end
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