Fix refactoring opportunities
This commit is contained in:
committed by
Thomas Citharel
parent
4d4fdaaffe
commit
20dfce5c83
@@ -24,7 +24,8 @@ defmodule Mobilizon.Service.ActivityPub.Transmogrifier do
|
||||
if is_binary(Enum.at(actor, 0)) do
|
||||
Enum.at(actor, 0)
|
||||
else
|
||||
Enum.find(actor, fn %{"type" => type} -> type in ["Person", "Service", "Application"] end)
|
||||
actor
|
||||
|> Enum.find(fn %{"type" => type} -> type in ["Person", "Service", "Application"] end)
|
||||
|> Map.get("id")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -348,7 +348,7 @@ defmodule Mobilizon.Service.ActivityPub.Utils do
|
||||
if is_nil(metadata.options) do
|
||||
res
|
||||
else
|
||||
options = struct(Mobilizon.Events.EventOptions, metadata.options) |> Map.from_struct()
|
||||
options = Events.EventOptions |> struct(metadata.options) |> Map.from_struct()
|
||||
|
||||
Enum.reduce(options, res, fn {key, value}, acc ->
|
||||
(value && Map.put(acc, camelize(key), value)) ||
|
||||
|
||||
Reference in New Issue
Block a user