aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/helpers/config_helper.ex
diff options
context:
space:
mode:
Diffstat (limited to 'lib/pleroma/helpers/config_helper.ex')
-rw-r--r--lib/pleroma/helpers/config_helper.ex21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/pleroma/helpers/config_helper.ex b/lib/pleroma/helpers/config_helper.ex
new file mode 100644
index 000000000..755918980
--- /dev/null
+++ b/lib/pleroma/helpers/config_helper.ex
@@ -0,0 +1,21 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
+# SPDX-License-Identifier: AGPL-3.0-only
+
+defmodule Pleroma.Helpers.ConfigHelper do
+ alias Pleroma.Config
+
+ require Logger
+
+ @spec instance_name() :: String.t() | nil
+ def instance_name, do: Config.get([:instance, :name])
+
+ @spec sender() :: {String.t() | nil, String.t() | nil}
+ def sender do
+ {instance_name(), instance_notify_email()}
+ end
+
+ defp instance_notify_email do
+ Config.get([:instance, :notify_email]) || Config.get([:instance, :email])
+ end
+end