From f231313b709cef32611927cabd8cadb5b0787dc5 Mon Sep 17 00:00:00 2001 From: lain Date: Mon, 28 Jan 2019 12:09:41 +0100 Subject: [PATCH] Add deprecation warning mechanism. --- lib/pleroma/application.ex | 2 ++ lib/pleroma/deprecation_warnings.ex | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 lib/pleroma/deprecation_warnings.ex diff --git a/lib/pleroma/application.ex b/lib/pleroma/application.ex index ad2797209..f63477934 100644 --- a/lib/pleroma/application.ex +++ b/lib/pleroma/application.ex @@ -22,6 +22,8 @@ def user_agent() do def start(_type, _args) do import Cachex.Spec + Task.start(&Pleroma.DeprecationWarnings.warn/0) + # Define workers and child supervisors to be supervised children = [ diff --git a/lib/pleroma/deprecation_warnings.ex b/lib/pleroma/deprecation_warnings.ex new file mode 100644 index 000000000..abb649919 --- /dev/null +++ b/lib/pleroma/deprecation_warnings.ex @@ -0,0 +1,20 @@ +# Pleroma: A lightweight social networking server +# Copyright © 2017-2019 Pleroma Authors +# SPDX-License-Identifier: AGPL-3.0-only + +defmodule Pleroma.DeprecationWarnings do + require Logger + + def check_frontend_config_mechanism() do + if Pleroma.Config.get(:fe) do + Logger.warn(""" + !!!DEPRECATION WARNING!!! + You are using the old configuration mechanism for the frontend. Please check config.md. + """) + end + end + + def warn do + check_frontend_config_mechanism() + end +end