From ae5beb7b6464d9bc4532693987d9d94cd5bac6bd Mon Sep 17 00:00:00 2001 From: scarlett Date: Thu, 25 Oct 2018 17:58:46 +0100 Subject: [PATCH] Make finmoji optional --- config/config.exs | 1 + lib/pleroma/formatter.ex | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/config/config.exs b/config/config.exs index 225ca914a..2d2cdda45 100644 --- a/config/config.exs +++ b/config/config.exs @@ -96,6 +96,7 @@ "text/html", "text/markdown" ], + finmoji_enabled: true, mrf_transparency: true config :pleroma, :markup, diff --git a/lib/pleroma/formatter.ex b/lib/pleroma/formatter.ex index 1756cc187..ecc102b62 100644 --- a/lib/pleroma/formatter.ex +++ b/lib/pleroma/formatter.ex @@ -94,9 +94,15 @@ def parse_mentions(text) do "woollysocks" ] - @finmoji_with_filenames Enum.map(@finmoji, fn finmoji -> - {finmoji, "/finmoji/128px/#{finmoji}-128.png"} - end) + @instance Application.get_env(:pleroma, :instance) + + @finmoji_with_filenames (if Keyword.get(@instance, :finmoji_enabled) do + Enum.map(@finmoji, fn finmoji -> + {finmoji, "/finmoji/128px/#{finmoji}-128.png"} + end) + else + [] + end) @emoji_from_file (with {:ok, default} <- File.read("config/emoji.txt") do custom =