Make finmoji optional
authorscarlett <nia@netbsd.org>
Thu, 25 Oct 2018 16:58:46 +0000 (17:58 +0100)
committerscarlett <nia@netbsd.org>
Thu, 25 Oct 2018 16:58:46 +0000 (17:58 +0100)
config/config.exs
lib/pleroma/formatter.ex

index 225ca914a8ff5299f2fd640285e802c497258697..2d2cdda45eeb5f918be6ed471da90534a6745f64 100644 (file)
@@ -96,6 +96,7 @@ config :pleroma, :instance,
     "text/html",
     "text/markdown"
   ],
+  finmoji_enabled: true,
   mrf_transparency: true
 
 config :pleroma, :markup,
index 1756cc187124aafd8c33af2e4d5051a74e9c6b01..ecc102b6227cb6403d99e5f8364c0b38aed1703d 100644 (file)
@@ -94,9 +94,15 @@ defmodule Pleroma.Formatter 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 =