Переглянути джерело

sloop around get_emoji/1 to check is_binary and have a fallthrough

default that returns empty
tags/v0.9.9
Thurloat 5 роки тому
джерело
коміт
4257f784bc
1 змінених файлів з 3 додано та 3 видалено
  1. +3
    -3
      lib/pleroma/formatter.ex

+ 3
- 3
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


Завантаження…
Відмінити
Зберегти