Add a deprecation warning for keyword policy's replace rule

This commit is contained in:
rinpatch 2019-04-04 09:18:52 +03:00
parent 2a004b566c
commit 594f8dca20
1 changed files with 17 additions and 0 deletions

View File

@ -23,8 +23,25 @@ defmodule Pleroma.Config.DeprecationWarnings do
end
end
def check_and_fix_keyword_replace do
replace = Pleroma.Config.get([:mrf_keyword, :replace])
if is_list(replace) do
Logger.warn("""
!!!DEPRECATION WARNING!!!
You are using the old configuration mechanism for KeywordPolicy's replace rule. Please check config.md.
""")
new_replace =
Enum.reduce(replace, %{}, fn {key, value}, acc -> Map.put(acc, key, value) end)
Pleroma.Config.put([:mrf_keyword, :replace], new_replace)
end
end
def warn do
check_frontend_config_mechanism()
check_hellthread_threshold()
check_and_fix_keyword_replace()
end
end