Fix typo in CSP Report-To header name
[akkoma] / lib / pleroma / clippy.ex
index 5e82ed8e2c261ea4478dc67f79044b6aa9329767..9c674e0755af7a02a47a8c18bf1fb80dab429056 100644 (file)
@@ -1,19 +1,20 @@
 # Pleroma: A lightweight social networking server
-# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
 defmodule Pleroma.Clippy do
   @moduledoc false
+
   # No software is complete until they have a Clippy implementation.
   # A ballmer peak _may_ be required to change this module.
 
-  def tip() do
+  def tip do
     tips()
     |> Enum.random()
     |> puts()
   end
 
-  def tips() do
+  def tips do
     host = Pleroma.Config.get([Pleroma.Web.Endpoint, :url, :host])
 
     [
@@ -25,7 +26,7 @@ defmodule Pleroma.Clippy do
       "Pleroma can federate to the Dark Web!\n
 - Tor: https://git.pleroma.social/pleroma/pleroma/wikis/Easy%20Onion%20Federation%20(Tor)
 - i2p: https://git.pleroma.social/pleroma/pleroma/wikis/I2p%20federation",
-      "Lists of Pleroma instances are available at:\n\n- http://distsn.org/pleroma-instances.html\n- https://fediverse.network/pleroma\n- https://the-federation.info/pleroma",
+      "Lists of Pleroma instances:\n\n- http://distsn.org/pleroma-instances.html\n- https://fediverse.network/pleroma\n- https://the-federation.info/pleroma",
       "Pleroma uses the LitePub protocol - https://litepub.social",
       "To receive more federated posts, subscribe to relays!\n
 - How-to: https://git.pleroma.social/pleroma/pleroma/wikis/Admin%20tasks#relay-managment
@@ -90,6 +91,17 @@ defmodule Pleroma.Clippy do
       noclippy_line: noclippy_line
     }
 
+    # surrond one/five line clippy with blank lines around to not fuck up the layout
+    #
+    # yes this fix sucks but it's good enough, have you ever seen a release of windows
+    # without some butched features anyway?
+    lines =
+      if length(lines) == 1 or length(lines) == 5 do
+        [""] ++ lines ++ [""]
+      else
+        lines
+      end
+
     clippy_line(lines, clippy_lines, env)
   rescue
     e ->