forked from potsda.mn/mobilizon
fix: fix Elixir 1.15 depreciations
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
5373f1378f
commit
da70427e32
|
@ -70,7 +70,7 @@ defmodule Mobilizon.Federation.ActivityPub do
|
|||
handle_existing_entity(url, entity, options)
|
||||
|
||||
{:error, e} ->
|
||||
Logger.warn("Something failed while fetching url #{url} #{inspect(e)}")
|
||||
Logger.warning("Something failed while fetching url #{url} #{inspect(e)}")
|
||||
{:error, e}
|
||||
end
|
||||
else
|
||||
|
|
|
@ -65,7 +65,7 @@ defmodule Mobilizon.Federation.ActivityPub.Fetcher do
|
|||
{:error, :transmogrifier_error}
|
||||
end
|
||||
else
|
||||
Logger.warn("Object origin check failed")
|
||||
Logger.warning("Object origin check failed")
|
||||
{:error, :object_origin_check_failed}
|
||||
end
|
||||
|
||||
|
@ -89,7 +89,7 @@ defmodule Mobilizon.Federation.ActivityPub.Fetcher do
|
|||
"object" => data
|
||||
})
|
||||
else
|
||||
Logger.warn("Object origin check failed")
|
||||
Logger.warning("Object origin check failed")
|
||||
{:error, :object_origin_check_failed}
|
||||
end
|
||||
|
||||
|
|
|
@ -89,13 +89,13 @@ defmodule Mobilizon.Federation.ActivityPub.Permission do
|
|||
_ ->
|
||||
case permission do
|
||||
:access ->
|
||||
Logger.warn("Actor #{actor_url} can't access #{object.url}")
|
||||
Logger.warning("Actor #{actor_url} can't access #{object.url}")
|
||||
|
||||
:update ->
|
||||
Logger.warn("Actor #{actor_url} can't update #{object.url}")
|
||||
Logger.warning("Actor #{actor_url} can't update #{object.url}")
|
||||
|
||||
:delete ->
|
||||
Logger.warn("Actor #{actor_url} can't delete #{object.url}")
|
||||
Logger.warning("Actor #{actor_url} can't delete #{object.url}")
|
||||
end
|
||||
|
||||
false
|
||||
|
|
|
@ -56,11 +56,11 @@ defmodule Mobilizon.Federation.ActivityPub.Relay do
|
|||
{:ok, activity, follow}
|
||||
else
|
||||
{:error, :person_no_follow} ->
|
||||
Logger.warn("Only group and instances can be followed")
|
||||
Logger.warning("Only group and instances can be followed")
|
||||
{:error, :person_no_follow}
|
||||
|
||||
{:error, e} ->
|
||||
Logger.warn("Error while following remote instance: #{inspect(e)}")
|
||||
Logger.warning("Error while following remote instance: #{inspect(e)}")
|
||||
{:error, e}
|
||||
end
|
||||
end
|
||||
|
@ -78,7 +78,7 @@ defmodule Mobilizon.Federation.ActivityPub.Relay do
|
|||
{:ok, activity, follow}
|
||||
else
|
||||
{:error, e} ->
|
||||
Logger.warn("Error while unfollowing remote instance: #{inspect(e)}")
|
||||
Logger.warning("Error while unfollowing remote instance: #{inspect(e)}")
|
||||
{:error, e}
|
||||
end
|
||||
end
|
||||
|
@ -96,7 +96,7 @@ defmodule Mobilizon.Federation.ActivityPub.Relay do
|
|||
{:ok, activity, follow}
|
||||
else
|
||||
{:error, e} ->
|
||||
Logger.warn("Error while accepting remote instance follow: #{inspect(e)}")
|
||||
Logger.warning("Error while accepting remote instance follow: #{inspect(e)}")
|
||||
{:error, e}
|
||||
end
|
||||
end
|
||||
|
@ -114,7 +114,7 @@ defmodule Mobilizon.Federation.ActivityPub.Relay do
|
|||
{:ok, activity, follow}
|
||||
else
|
||||
{:error, e} ->
|
||||
Logger.warn("Error while rejecting remote instance follow: #{inspect(e)}")
|
||||
Logger.warning("Error while rejecting remote instance follow: #{inspect(e)}")
|
||||
{:error, e}
|
||||
end
|
||||
end
|
||||
|
@ -137,7 +137,7 @@ defmodule Mobilizon.Federation.ActivityPub.Relay do
|
|||
})
|
||||
else
|
||||
{:error, e} ->
|
||||
Logger.warn("Error while refreshing remote instance: #{inspect(e)}")
|
||||
Logger.warning("Error while refreshing remote instance: #{inspect(e)}")
|
||||
{:error, e}
|
||||
end
|
||||
end
|
||||
|
|
|
@ -203,7 +203,7 @@ defmodule Mobilizon.Federation.ActivityPub.Transmogrifier do
|
|||
Actions.Delete.delete(entity, Relay.get_actor(), false)
|
||||
|
||||
{:error, err} ->
|
||||
Logger.warn("Error while fetching object from URL: #{inspect(err)}")
|
||||
Logger.warning("Error while fetching object from URL: #{inspect(err)}")
|
||||
:error
|
||||
end
|
||||
end
|
||||
|
@ -219,11 +219,11 @@ defmodule Mobilizon.Federation.ActivityPub.Transmogrifier do
|
|||
{:ok, activity, object}
|
||||
else
|
||||
{:error, :person_no_follow} ->
|
||||
Logger.warn("Only group and instances can be followed")
|
||||
Logger.warning("Only group and instances can be followed")
|
||||
:error
|
||||
|
||||
{:error, e} ->
|
||||
Logger.warn("Unable to handle Follow activity #{inspect(e)}")
|
||||
Logger.warning("Unable to handle Follow activity #{inspect(e)}")
|
||||
:error
|
||||
end
|
||||
end
|
||||
|
@ -325,14 +325,14 @@ defmodule Mobilizon.Federation.ActivityPub.Transmogrifier do
|
|||
:error
|
||||
|
||||
{:object_not_found, nil} ->
|
||||
Logger.warn(
|
||||
Logger.warning(
|
||||
"Unable to process Accept activity #{inspect(id)}. Object #{inspect(accepted_object)} wasn't found."
|
||||
)
|
||||
|
||||
:error
|
||||
|
||||
e ->
|
||||
Logger.warn(
|
||||
Logger.warning(
|
||||
"Unable to process Accept activity #{inspect(id)} for object #{inspect(accepted_object)} only returned #{inspect(e)}"
|
||||
)
|
||||
|
||||
|
@ -353,14 +353,14 @@ defmodule Mobilizon.Federation.ActivityPub.Transmogrifier do
|
|||
{:ok, activity, object}
|
||||
else
|
||||
{:object_not_found, nil} ->
|
||||
Logger.warn(
|
||||
Logger.warning(
|
||||
"Unable to process Reject activity #{inspect(id)}. Object #{inspect(rejected_object)} wasn't found."
|
||||
)
|
||||
|
||||
:error
|
||||
|
||||
e ->
|
||||
Logger.warn(
|
||||
Logger.warning(
|
||||
"Unable to process Reject activity #{inspect(id)} for object #{inspect(rejected_object)} only returned #{inspect(e)}"
|
||||
)
|
||||
|
||||
|
@ -405,7 +405,7 @@ defmodule Mobilizon.Federation.ActivityPub.Transmogrifier do
|
|||
{:ok, activity, new_actor}
|
||||
else
|
||||
{:error, :update_not_allowed} ->
|
||||
Logger.warn(
|
||||
Logger.warning(
|
||||
"Activity tried to update an actor that's local or not a group: #{inspect(params)}"
|
||||
)
|
||||
|
||||
|
@ -485,7 +485,7 @@ defmodule Mobilizon.Federation.ActivityPub.Transmogrifier do
|
|||
{:ok, activity, new_post}
|
||||
else
|
||||
{:origin_check, _} ->
|
||||
Logger.warn("Actor tried to update a post but doesn't has the required role")
|
||||
Logger.warning("Actor tried to update a post but doesn't has the required role")
|
||||
:error
|
||||
|
||||
_e ->
|
||||
|
@ -692,7 +692,7 @@ defmodule Mobilizon.Federation.ActivityPub.Transmogrifier do
|
|||
{:ok, activity, object}
|
||||
else
|
||||
{:only_organizer, true} ->
|
||||
Logger.warn(
|
||||
Logger.warning(
|
||||
"Actor #{inspect(actor)} tried to leave event #{inspect(object)} but it was the only organizer so we didn't detach it"
|
||||
)
|
||||
|
||||
|
@ -742,14 +742,14 @@ defmodule Mobilizon.Federation.ActivityPub.Transmogrifier do
|
|||
Actions.Remove.remove(member, group, moderator, false)
|
||||
else
|
||||
{:is_admin, {:ok, %Member{}}} ->
|
||||
Logger.warn(
|
||||
Logger.warning(
|
||||
"Person #{inspect(actor)} is not an admin from #{inspect(origin)} and can't remove member #{inspect(object)}"
|
||||
)
|
||||
|
||||
{:error, "Member already removed"}
|
||||
|
||||
{:is_member, {:ok, %Member{role: :rejected}}} ->
|
||||
Logger.warn("Member #{inspect(object)} already removed from #{inspect(origin)}")
|
||||
Logger.warning("Member #{inspect(object)} already removed from #{inspect(origin)}")
|
||||
{:error, "Member already removed"}
|
||||
end
|
||||
end
|
||||
|
@ -949,7 +949,7 @@ defmodule Mobilizon.Federation.ActivityPub.Transmogrifier do
|
|||
{:ok, activity, participant}
|
||||
else
|
||||
{:join_event, {:ok, _activity, %Participant{role: :rejected}}} ->
|
||||
Logger.warn(
|
||||
Logger.warning(
|
||||
"Tried to handle an Reject activity on a Join activity with a event object but the participant is already rejected"
|
||||
)
|
||||
|
||||
|
@ -1100,7 +1100,7 @@ defmodule Mobilizon.Federation.ActivityPub.Transmogrifier do
|
|||
{:ok, object}
|
||||
|
||||
err ->
|
||||
Logger.warn("Error while fetching #{inspect(object)}")
|
||||
Logger.warning("Error while fetching #{inspect(object)}")
|
||||
{:error, err}
|
||||
end
|
||||
end
|
||||
|
@ -1242,7 +1242,7 @@ defmodule Mobilizon.Federation.ActivityPub.Transmogrifier do
|
|||
Permission.can_delete_group_object?(actor, entity) do
|
||||
Actions.Delete.delete(entity, actor, false)
|
||||
else
|
||||
Logger.warn("Object origin check failed")
|
||||
Logger.warning("Object origin check failed")
|
||||
:error
|
||||
end
|
||||
|
||||
|
|
|
@ -202,7 +202,7 @@ defmodule Mobilizon.Federation.ActivityStream.Converter.Comment do
|
|||
|
||||
# Anything else is kind of a MP
|
||||
{:error, parent} ->
|
||||
Logger.warn("Parent object is something we don't handle")
|
||||
Logger.warning("Parent object is something we don't handle")
|
||||
Logger.debug(inspect(parent))
|
||||
data
|
||||
end
|
||||
|
|
|
@ -57,7 +57,7 @@ defmodule Mobilizon.GraphQL.API.Reports do
|
|||
end
|
||||
|
||||
if antispam_response != :ok do
|
||||
Logger.warn("Antispam response has been #{inspect(antispam_response)}")
|
||||
Logger.warning("Antispam response has been #{inspect(antispam_response)}")
|
||||
end
|
||||
|
||||
{:ok, report}
|
||||
|
|
|
@ -123,7 +123,7 @@ defmodule Mobilizon.GraphQL.Error do
|
|||
defp metadata(:unknown), do: {500, dgettext("errors", "Something went wrong")}
|
||||
|
||||
defp metadata(code) do
|
||||
Logger.warn("Unhandled error code: #{inspect(code)}")
|
||||
Logger.warning("Unhandled error code: #{inspect(code)}")
|
||||
{422, to_string(code)}
|
||||
end
|
||||
|
||||
|
|
|
@ -87,7 +87,7 @@ defmodule Mix.Tasks.Mobilizon.Actors.Refresh do
|
|||
rescue
|
||||
_ ->
|
||||
if verbose do
|
||||
Logger.warn("Failed to refresh #{username}")
|
||||
Logger.warning("Failed to refresh #{username}")
|
||||
end
|
||||
|
||||
nil
|
||||
|
|
|
@ -10,7 +10,7 @@ defmodule Mobilizon.Service.GitStatus do
|
|||
|
||||
_ ->
|
||||
# Fallback on Mix version
|
||||
Logger.warn("Could not read git commit hash, using Mix version code instead.")
|
||||
Logger.warning("Could not read git commit hash, using Mix version code instead.")
|
||||
Mix.Project.config()[:version]
|
||||
end)
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@ defmodule Mobilizon.Service.Notifier.Email do
|
|||
end
|
||||
|
||||
defp can_send_activity?(activity, user, options) do
|
||||
Logger.warn(
|
||||
Logger.warning(
|
||||
"Can't check if user #{inspect(user)} can be sent an activity (#{inspect(activity)}) (#{inspect(options)})"
|
||||
)
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ defmodule Mobilizon.Web.Auth.Guardian do
|
|||
end
|
||||
rescue
|
||||
e in Ecto.NoResultsError ->
|
||||
Logger.warn("Received token claim for non existing user: #{inspect(e)}")
|
||||
Logger.warning("Received token claim for non existing user: #{inspect(e)}")
|
||||
{:error, :no_result}
|
||||
end
|
||||
end
|
||||
|
|
|
@ -33,7 +33,7 @@ defmodule Mobilizon.Web.AuthController do
|
|||
%{assigns: %{ueberauth_failure: fails}} = conn,
|
||||
%{"provider" => provider} = _params
|
||||
) do
|
||||
Logger.warn("Unable to login user with #{provider} #{inspect(fails)}")
|
||||
Logger.warning("Unable to login user with #{provider} #{inspect(fails)}")
|
||||
|
||||
redirect_to_error(conn, :unknown_error, provider)
|
||||
end
|
||||
|
@ -75,7 +75,7 @@ defmodule Mobilizon.Web.AuthController do
|
|||
})
|
||||
else
|
||||
err ->
|
||||
Logger.warn("Unable to login user \"#{email}\" #{inspect(err)}")
|
||||
Logger.warning("Unable to login user \"#{email}\" #{inspect(err)}")
|
||||
redirect_to_error(conn, :unknown_error, strategy)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -65,7 +65,7 @@ defmodule Mobilizon.Web.FeedController do
|
|||
{:error, :not_found}
|
||||
|
||||
err ->
|
||||
Logger.warn("Unable to find feed data cached for key #{key}, returned #{inspect(err)}")
|
||||
Logger.warning("Unable to find feed data cached for key #{key}, returned #{inspect(err)}")
|
||||
{:error, :not_found}
|
||||
end
|
||||
end
|
||||
|
@ -89,7 +89,7 @@ defmodule Mobilizon.Web.FeedController do
|
|||
{:error, :not_found}
|
||||
|
||||
err ->
|
||||
Logger.warn("Unable to find feed data cached for key #{key}, returned #{inspect(err)}")
|
||||
Logger.warning("Unable to find feed data cached for key #{key}, returned #{inspect(err)}")
|
||||
{:error, :not_found}
|
||||
end
|
||||
end
|
||||
|
|
|
@ -70,7 +70,7 @@ defmodule Mobilizon.Web.Email.Group do
|
|||
%Actor{type: :Group, preferred_username: group_username},
|
||||
user
|
||||
) do
|
||||
Logger.warn(
|
||||
Logger.warning(
|
||||
"Unable to notify group follower user #{user.email} for event #{event_uuid} from group #{group_username}"
|
||||
)
|
||||
|
||||
|
|
|
@ -126,7 +126,7 @@ defmodule Mobilizon.Web.ReverseProxy do
|
|||
|> halt()
|
||||
|
||||
{:is_url, false} ->
|
||||
Logger.warn("Tried to reverse proxy URL #{inspect(url)}")
|
||||
Logger.warning("Tried to reverse proxy URL #{inspect(url)}")
|
||||
|
||||
conn
|
||||
|> error_or_redirect(url, 400, "Request failed", opts)
|
||||
|
@ -202,7 +202,7 @@ defmodule Mobilizon.Web.ReverseProxy do
|
|||
halt(conn)
|
||||
|
||||
{:error, error, conn} ->
|
||||
Logger.warn(
|
||||
Logger.warning(
|
||||
"#{__MODULE__} request to #{url} failed while reading/chunking: #{inspect(error)}"
|
||||
)
|
||||
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
<%= gettext "Your participation to %{event} on %{instance} has been cancelled!", event: @event.title, instance: @instance_name %>
|
||||
==
|
||||
<%= gettext "Your instance's moderation team has decided to suspend %{actor_name} (%{actor_address}). All of their events have been removed and your participation to event %{event} cancelled.", actor_name: @actor.name || @actor.preferred_username, event: @event.title, actor_address: if @actor.domain, do: "@#{@actor.preferred_username}@#{@actor.domain}", else: "@#{@actor.preferred_username}" %>
|
||||
<%= gettext "Your instance's moderation team has decided to suspend %{actor_name} (%{actor_address}). All of their events have been removed and your participation to event %{event} cancelled.", actor_name: @actor.name || @actor.preferred_username, event: @event.title, actor_address: preferred_username_and_domain(@actor) %>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<%= gettext "The group %{group} has been suspended on %{instance}!", group: (@group.name || @group.preferred_username), instance: @instance_name %>
|
||||
==
|
||||
<%= gettext "Your instance's moderation team has decided to suspend %{group_name} (%{group_address}). You are no longer a member of this group.", group_name: @group.name, group_address: if @group.domain, do: "@#{@group.preferred_username}@#{@group.domain}", else: "@#{@group.preferred_username}" %>
|
||||
<%= gettext "Your instance's moderation team has decided to suspend %{group_name} (%{group_address}). You are no longer a member of this group.", group_name: @group.name, group_address: preferred_username_and_domain(@group) %>
|
||||
<%= if is_nil(@group.domain) do %>
|
||||
<%= gettext "As this group was located on this instance, all of it's data has been irretrievably deleted." %>
|
||||
<% else %>
|
||||
|
|
|
@ -25,7 +25,7 @@ defmodule Mobilizon.Web.Upload.Filter.AnalyzeMetadata do
|
|||
rescue
|
||||
e in ErlangError ->
|
||||
require Logger
|
||||
Logger.warn("#{__MODULE__}: #{inspect(e)}")
|
||||
Logger.warning("#{__MODULE__}: #{inspect(e)}")
|
||||
{:ok, :noop}
|
||||
end
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ defmodule Mobilizon.Web.Upload.Filter.BlurHash do
|
|||
{:ok, :filtered, %Upload{upload | blurhash: generate_blurhash(file)}}
|
||||
rescue
|
||||
e in ErlangError ->
|
||||
Logger.warn("#{__MODULE__}: #{inspect(e)}")
|
||||
Logger.warning("#{__MODULE__}: #{inspect(e)}")
|
||||
{:ok, :noop}
|
||||
end
|
||||
|
||||
|
|
|
@ -28,11 +28,11 @@ defmodule Mobilizon.Web.Upload.Filter.Optimize do
|
|||
{:ok, :filtered}
|
||||
|
||||
{:error, :file_not_found} ->
|
||||
Logger.warn("Unable to optimize file #{file}. File was not found")
|
||||
Logger.warning("Unable to optimize file #{file}. File was not found")
|
||||
{:error, :file_not_found}
|
||||
|
||||
{:error, err} ->
|
||||
Logger.warn(
|
||||
Logger.warning(
|
||||
"Unable to optimize file #{file}. The return from the process was #{inspect(err)}"
|
||||
)
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ defmodule Mobilizon.Web.ErrorView do
|
|||
# template is found, let's render it as 500
|
||||
def template_not_found(template, assigns) do
|
||||
require Logger
|
||||
Logger.warn("Template #{inspect(template)} not found")
|
||||
Logger.warning("Template #{inspect(template)} not found")
|
||||
render("500.html", assigns)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue