- def format(%{activity: %{data: %{"type" => "Create"}}}, actor) do
- %{
- title: "New Mention",
- body: "@#{actor.nickname} has mentiond you",
- icon: User.avatar_url(actor)
- }
- end
-
- def format(%{activity: %{data: %{"type" => "Follow"}}}, actor) do
- %{
- title: "New Follower",
- body: "@#{actor.nickname} has followed you",
- icon: User.avatar_url(actor)
- }
- end
-
- def format(%{activity: %{data: %{"type" => "Announce"}}}, actor) do
- %{
- title: "New Repeat",
- body: "@#{actor.nickname} has repeated your post",
- icon: User.avatar_url(actor)
- }
+ defp format_title(%{activity: %{data: %{"type" => type}}}) do
+ case type do
+ "Create" -> "New Mention"
+ "Follow" -> "New Follower"
+ "Announce" -> "New Repeat"
+ "Like" -> "New Favorite"
+ end