From 56fd7dbdd7e3f1a0bb05430ed4805d8715e54935 Mon Sep 17 00:00:00 2001
From: William Pitcock <nenolod@dereferenced.org>
Date: Sat, 25 May 2019 04:39:32 +0000
Subject: [PATCH] remove @websub and @ostatus module-level constants

---
 config/config.exs                          |  2 --
 config/test.exs                            |  2 --
 lib/pleroma/web/federator/federator.ex     |  8 +++-----
 test/support/ostatus_mock.ex               | 11 -----------
 test/support/websub_mock.ex                |  9 ---------
 test/web/websub/websub_controller_test.exs |  1 -
 6 files changed, 3 insertions(+), 30 deletions(-)
 delete mode 100644 test/support/ostatus_mock.ex
 delete mode 100644 test/support/websub_mock.ex

diff --git a/config/config.exs b/config/config.exs
index 01827fb5f..68168b279 100644
--- a/config/config.exs
+++ b/config/config.exs
@@ -184,8 +184,6 @@
   "application/ld+json" => ["activity+json"]
 }
 
-config :pleroma, :websub, Pleroma.Web.Websub
-config :pleroma, :ostatus, Pleroma.Web.OStatus
 config :tesla, adapter: Tesla.Adapter.Hackney
 
 # Configures http settings, upstream proxy etc.
diff --git a/config/test.exs b/config/test.exs
index 3bc407840..41cddb9bd 100644
--- a/config/test.exs
+++ b/config/test.exs
@@ -39,8 +39,6 @@
 # Reduce hash rounds for testing
 config :pbkdf2_elixir, rounds: 1
 
-#config :pleroma, :websub, Pleroma.Web.WebsubMock
-#config :pleroma, :ostatus, Pleroma.Web.OStatusMock
 config :tesla, adapter: Tesla.Mock
 config :pleroma, :rich_media, enabled: false
 
diff --git a/lib/pleroma/web/federator/federator.ex b/lib/pleroma/web/federator/federator.ex
index 6b0b75284..f4c9fe284 100644
--- a/lib/pleroma/web/federator/federator.ex
+++ b/lib/pleroma/web/federator/federator.ex
@@ -11,13 +11,11 @@ defmodule Pleroma.Web.Federator do
   alias Pleroma.Web.ActivityPub.Utils
   alias Pleroma.Web.Federator.Publisher
   alias Pleroma.Web.Federator.RetryQueue
+  alias Pleroma.Web.OStatus
   alias Pleroma.Web.Websub
 
   require Logger
 
-  @websub Application.get_env(:pleroma, :websub)
-  @ostatus Application.get_env(:pleroma, :ostatus)
-
   def init do
     # 1 minute
     Process.sleep(1000 * 60)
@@ -87,12 +85,12 @@ def perform(:verify_websub, websub) do
       "Running WebSub verification for #{websub.id} (#{websub.topic}, #{websub.callback})"
     end)
 
-    @websub.verify(websub)
+    Websub.verify(websub)
   end
 
   def perform(:incoming_doc, doc) do
     Logger.info("Got document, trying to parse")
-    @ostatus.handle_incoming(doc)
+    OStatus.handle_incoming(doc)
   end
 
   def perform(:incoming_ap_doc, params) do
diff --git a/test/support/ostatus_mock.ex b/test/support/ostatus_mock.ex
deleted file mode 100644
index 9c0f2f323..000000000
--- a/test/support/ostatus_mock.ex
+++ /dev/null
@@ -1,11 +0,0 @@
-# Pleroma: A lightweight social networking server
-# Copyright © 2017-2018 Pleroma Authors <https://pleroma.social/>
-# SPDX-License-Identifier: AGPL-3.0-only
-
-defmodule Pleroma.Web.OStatusMock do
-  import Pleroma.Factory
-
-  def handle_incoming(_doc) do
-    insert(:note_activity)
-  end
-end
diff --git a/test/support/websub_mock.ex b/test/support/websub_mock.ex
deleted file mode 100644
index e3d5a5b16..000000000
--- a/test/support/websub_mock.ex
+++ /dev/null
@@ -1,9 +0,0 @@
-# Pleroma: A lightweight social networking server
-# Copyright © 2017-2018 Pleroma Authors <https://pleroma.social/>
-# SPDX-License-Identifier: AGPL-3.0-only
-
-defmodule Pleroma.Web.WebsubMock do
-  def verify(sub) do
-    {:ok, sub}
-  end
-end
diff --git a/test/web/websub/websub_controller_test.exs b/test/web/websub/websub_controller_test.exs
index bf2ee31ee..f79745d58 100644
--- a/test/web/websub/websub_controller_test.exs
+++ b/test/web/websub/websub_controller_test.exs
@@ -5,7 +5,6 @@
 defmodule Pleroma.Web.Websub.WebsubControllerTest do
   use Pleroma.Web.ConnCase
   import Pleroma.Factory
-  alias Pleroma.Activity
   alias Pleroma.Repo
   alias Pleroma.Web.Websub
   alias Pleroma.Web.Websub.WebsubClientSubscription