projects
/
akkoma
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a9c0f39
)
sloop around get_emoji/1 to check is_binary and have a fallthrough
author
Thurloat
<thurloat@gmail.com>
Sun, 2 Sep 2018 23:44:37 +0000
(20:44 -0300)
committer
Thurloat
<thurloat@gmail.com>
Sun, 2 Sep 2018 23:44:37 +0000
(20:44 -0300)
default that returns empty
lib/pleroma/formatter.ex
patch
|
blob
|
history
diff --git
a/lib/pleroma/formatter.ex
b/lib/pleroma/formatter.ex
index fc2c643daef7983e221cf48dd466611740c9d6d0..e5ccc7a493cee9f60a67a12b16cda6ca709b62b6 100644
(file)
--- a/
lib/pleroma/formatter.ex
+++ b/
lib/pleroma/formatter.ex
@@
-157,12
+157,12
@@
defmodule Pleroma.Formatter do
end)
end
- def get_emoji(nil), do: []
-
- def get_emoji(text) do
+ def get_emoji(text) when is_binary(text) do
Enum.filter(@emoji, fn {emoji, _} -> String.contains?(text, ":#{emoji}:") end)
end
+ def get_emoji(_), do: []
+
def get_custom_emoji() do
@emoji
end