Skip to content
GitLab
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
887db076
Commit
887db076
authored
Feb 03, 2021
by
feld
Browse files
Load an emoji.txt specific to the test env
parent
a7864a94
Pipeline
#34677
passed with stages
in 10 minutes and 47 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
config/emoji.txt
View file @
887db076
firefox, /emoji/Firefox.gif, Gif,Fun
blank, /emoji/blank.png, Fun
dinosaur, /emoji/dino walking.gif, Gif
external_emoji, https://example.com/emoji.png
lib/pleroma/emoji/loader.ex
View file @
887db076
...
...
@@ -77,10 +77,19 @@ def load do
# it should run even if there are no emoji packs
shortcode_globs
=
Config
.
get
([
:emoji
,
:shortcode_globs
],
[])
# for testing emoji.txt entries we do not want exposed in normal operation
test_emoji
=
if
Mix
.
env
()
==
:test
do
load_from_file
(
"test/config/emoji.txt"
,
emoji_groups
)
else
[]
end
emojis_txt
=
(
load_from_file
(
"config/emoji.txt"
,
emoji_groups
)
++
load_from_file
(
"config/custom_emoji.txt"
,
emoji_groups
)
++
load_from_globs
(
shortcode_globs
,
emoji_groups
))
load_from_globs
(
shortcode_globs
,
emoji_groups
)
++
test_emoji
)
|>
Enum
.
reject
(
fn
value
->
value
==
nil
end
)
Enum
.
map
(
emojis
++
emojis_txt
,
&
prepare_emoji
/
1
)
...
...
test/config/emoji.txt
0 → 100644
View file @
887db076
external_emoji, https://example.com/emoji.png
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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