Fix moderation log crash
This commit is contained in:
parent
1a60215076
commit
1b83a0694a
@ -374,6 +374,24 @@ defmodule Pleroma.ModerationLog do
|
||||
data: %{
|
||||
"actor" => %{"nickname" => actor_nickname},
|
||||
"action" => "activate",
|
||||
"subject" => user
|
||||
}
|
||||
})
|
||||
when is_map(user) do
|
||||
get_log_entry_message(%ModerationLog{
|
||||
data: %{
|
||||
"actor" => %{"nickname" => actor_nickname},
|
||||
"action" => "activate",
|
||||
"subject" => [user]
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
@spec get_log_entry_message(ModerationLog) :: String.t()
|
||||
def get_log_entry_message(%ModerationLog{
|
||||
data: %{
|
||||
"actor" => %{"nickname" => actor_nickname},
|
||||
"action" => "activate",
|
||||
"subject" => users
|
||||
}
|
||||
}) do
|
||||
@ -385,6 +403,24 @@ defmodule Pleroma.ModerationLog do
|
||||
data: %{
|
||||
"actor" => %{"nickname" => actor_nickname},
|
||||
"action" => "deactivate",
|
||||
"subject" => user
|
||||
}
|
||||
})
|
||||
when is_map(user) do
|
||||
get_log_entry_message(%ModerationLog{
|
||||
data: %{
|
||||
"actor" => %{"nickname" => actor_nickname},
|
||||
"action" => "deactivate",
|
||||
"subject" => [user]
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
@spec get_log_entry_message(ModerationLog) :: String.t()
|
||||
def get_log_entry_message(%ModerationLog{
|
||||
data: %{
|
||||
"actor" => %{"nickname" => actor_nickname},
|
||||
"action" => "deactivate",
|
||||
"subject" => users
|
||||
}
|
||||
}) do
|
||||
@ -424,6 +460,26 @@ defmodule Pleroma.ModerationLog do
|
||||
data: %{
|
||||
"actor" => %{"nickname" => actor_nickname},
|
||||
"action" => "grant",
|
||||
"subject" => user,
|
||||
"permission" => permission
|
||||
}
|
||||
})
|
||||
when is_map(user) do
|
||||
get_log_entry_message(%ModerationLog{
|
||||
data: %{
|
||||
"actor" => %{"nickname" => actor_nickname},
|
||||
"action" => "grant",
|
||||
"subject" => [user],
|
||||
"permission" => permission
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
@spec get_log_entry_message(ModerationLog) :: String.t()
|
||||
def get_log_entry_message(%ModerationLog{
|
||||
data: %{
|
||||
"actor" => %{"nickname" => actor_nickname},
|
||||
"action" => "grant",
|
||||
"subject" => users,
|
||||
"permission" => permission
|
||||
}
|
||||
@ -436,6 +492,26 @@ defmodule Pleroma.ModerationLog do
|
||||
data: %{
|
||||
"actor" => %{"nickname" => actor_nickname},
|
||||
"action" => "revoke",
|
||||
"subject" => user,
|
||||
"permission" => permission
|
||||
}
|
||||
})
|
||||
when is_map(user) do
|
||||
get_log_entry_message(%ModerationLog{
|
||||
data: %{
|
||||
"actor" => %{"nickname" => actor_nickname},
|
||||
"action" => "revoke",
|
||||
"subject" => [user],
|
||||
"permission" => permission
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
@spec get_log_entry_message(ModerationLog) :: String.t()
|
||||
def get_log_entry_message(%ModerationLog{
|
||||
data: %{
|
||||
"actor" => %{"nickname" => actor_nickname},
|
||||
"action" => "revoke",
|
||||
"subject" => users,
|
||||
"permission" => permission
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user