Merge branch 'relay-fix-admin-fe' into 'develop'
authorfeld <feld@feld.me>
Mon, 24 Aug 2020 17:03:18 +0000 (17:03 +0000)
committerfeld <feld@feld.me>
Mon, 24 Aug 2020 17:03:18 +0000 (17:03 +0000)
Relay fix for admin-fe

See merge request pleroma/pleroma!2902

1  2 
lib/pleroma/web/activity_pub/activity_pub.ex

index 8c5b7dac2c528a781f33f3f9738c0a8db6c11dd7,04478bc33c01621342dd5d28e8107f848186b4ad..624a508ae3d907438d0df2301cdb1ea458580257
@@@ -85,7 -85,7 +85,7 @@@ defmodule Pleroma.Web.ActivityPub.Activ
  
    defp increase_replies_count_if_reply(_create_data), do: :noop
  
 -  @object_types ["ChatMessage", "Question", "Answer"]
 +  @object_types ~w[ChatMessage Question Answer Audio Event]
    @spec persist(map(), keyword()) :: {:ok, Activity.t() | Object.t()}
    def persist(%{"type" => type} = object, meta) when type in @object_types do
      with {:ok, object} <- Object.create(object) do
    end
  
    def maybe_handle_clashing_nickname(data) do
-     nickname = data[:nickname]
-     with %User{} = old_user <- User.get_by_nickname(nickname),
+     with nickname when is_binary(nickname) <- data[:nickname],
+          %User{} = old_user <- User.get_by_nickname(nickname),
           {_, false} <- {:ap_id_comparison, data[:ap_id] == old_user.ap_id} do
        Logger.info(
          "Found an old user for #{nickname}, the old ap id is #{old_user.ap_id}, new one is #{
      else
        {:ap_id_comparison, true} ->
          Logger.info(
-           "Found an old user for #{nickname}, but the ap id #{data[:ap_id]} is the same as the new user. Race condition? Not changing anything."
+           "Found an old user for #{data[:nickname]}, but the ap id #{data[:ap_id]} is the same as the new user. Race condition? Not changing anything."
          )
  
        _ ->