summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Felder <feld@feld.me>2024-06-11 18:38:41 -0400
committerMark Felder <feld@feld.me>2024-06-11 18:38:41 -0400
commit6a9d9da26feefe9b19e8072fd378f01a977b9d1a (patch)
treec68d7105c05ecd8726c22ecd17e78d47203feb1e
parenta291a6b8c0c6e27ba6f9a03d9a1183184fc2ef1d (diff)
downloadpleroma-6a9d9da26feefe9b19e8072fd378f01a977b9d1a.tar.gz
pleroma-6a9d9da26feefe9b19e8072fd378f01a977b9d1a.zip
Cyclical complexity
-rw-r--r--lib/pleroma/web/push/impl.ex26
1 files changed, 11 insertions, 15 deletions
diff --git a/lib/pleroma/web/push/impl.ex b/lib/pleroma/web/push/impl.ex
index 65801922d..2bcfa97f5 100644
--- a/lib/pleroma/web/push/impl.ex
+++ b/lib/pleroma/web/push/impl.ex
@@ -201,19 +201,15 @@ defmodule Pleroma.Web.Push.Impl do
"New Direct Message"
end
- def format_title(%{type: type}) do
- case type do
- "mention" -> "New Mention"
- "status" -> "New Status"
- "follow" -> "New Follower"
- "follow_request" -> "New Follow Request"
- "reblog" -> "New Repeat"
- "favourite" -> "New Favorite"
- "update" -> "New Update"
- "pleroma:chat_mention" -> "New Chat Message"
- "pleroma:emoji_reaction" -> "New Reaction"
- "poll" -> "Poll Results"
- type -> "New #{String.capitalize(type || "event")}"
- end
- end
+ def format_title(%{type: "mention"}), do: "New Mention"
+ def format_title(%{type: "status"}), do: "New Status"
+ def format_title(%{type: "follow"}), do: "New Follower"
+ def format_title(%{type: "follow_request"}), do: "New Follow Request"
+ def format_title(%{type: "reblog"}), do: "New Repeat"
+ def format_title(%{type: "favourite"}), do: "New Favorite"
+ def format_title(%{type: "update"}), do: "New Update"
+ def format_title(%{type: "pleroma:chat_mention"}), do: "New Chat Message"
+ def format_title(%{type: "pleroma:emoji_reaction"}), do: "New Reaction"
+ def format_title(%{type: "poll"}), do: "Poll Results"
+ def format_title(%{type: type}), do: "New #{String.capitalize(type || "event")}"
end