Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into remake-remodel
authorlain <lain@soykaf.club>
Tue, 5 Nov 2019 14:21:00 +0000 (15:21 +0100)
committerlain <lain@soykaf.club>
Tue, 5 Nov 2019 14:21:00 +0000 (15:21 +0100)
15 files changed:
1  2 
lib/pleroma/object/containment.ex
lib/pleroma/web/activity_pub/activity_pub.ex
lib/pleroma/web/activity_pub/transmogrifier.ex
lib/pleroma/web/common_api/common_api.ex
test/notification_test.exs
test/tasks/database_test.exs
test/user_test.exs
test/web/activity_pub/transmogrifier_test.exs
test/web/common_api/common_api_test.exs
test/web/mastodon_api/controllers/notification_controller_test.exs
test/web/mastodon_api/controllers/status_controller_test.exs
test/web/ostatus/ostatus_controller_test.exs
test/web/pleroma_api/controllers/account_controller_test.exs
test/web/push/impl_test.exs
test/web/streamer/streamer_test.exs

index edbe9238108480b216fe159ca247040b1811c812,68535c09e66ab962bcbcb5ce91a53303f48b6d0f..c53f29cd68b5f5c956b6422a1620797a17c152d7
@@@ -32,18 -32,23 +32,35 @@@ defmodule Pleroma.Object.Containment d
      get_actor(%{"actor" => actor})
    end
  
 +  def get_object(%{"object" => id}) when is_binary(id) do
 +    id
 +  end
 +
 +  def get_object(%{"object" => %{"id" => id}}) when is_binary(id) do
 +    id
 +  end
 +
 +  def get_object(_) do
 +    nil
 +  end
 +
+   # TODO: We explicitly allow 'tag' URIs through, due to references to legacy OStatus
+   # objects being present in the test suite environment.  Once these objects are
+   # removed, please also remove this.
+   if Mix.env() == :test do
+     defp compare_uris(_, %URI{scheme: "tag"}), do: :ok
+   end
+   defp compare_uris(%URI{} = id_uri, %URI{} = other_uri) do
+     if id_uri.host == other_uri.host do
+       :ok
+     else
+       :error
+     end
+   end
+   defp compare_uris(_, _), do: :error
    @doc """
    Checks that an imported AP object's actor matches the domain it came from.
    """
index 0789ec31c003575d8038eccf35b91c0e69862a03,51a9c61691b8471972ec306292c8c5064a6faac1..72a29e50ffc5460043a4b6410c8d1d7b9bced1c8
@@@ -147,9 -131,8 +148,9 @@@ defmodule Pleroma.Web.ActivityPub.Activ
           {_, true} <- {:remote_limit_error, check_remote_limit(map)},
           {:ok, map} <- MRF.filter(map),
           {recipients, _, _} = get_recipients(map),
 +         # ???
           {:fake, false, map, recipients} <- {:fake, fake, map, recipients},
-          :ok <- Containment.contain_child(map),
+          {:containment, :ok} <- {:containment, Containment.contain_child(map)},
           {:ok, map, object} <- insert_full_object(map) do
        {:ok, activity} =
          Repo.insert(%Activity{
Simple merge
Simple merge
Simple merge
index 2bbd8a15163693a98dbe5179e98fe728e07cafb7,a96fd860b50fe2edb08996e0cf7af3d5bc93137b..2ce201e2e288bef40e1ca7926561f615d8b962f4
@@@ -17,8 -18,10 +18,11 @@@ defmodule Pleroma.Web.MastodonAPI.Statu
    alias Pleroma.Web.CommonAPI
  
    import Pleroma.Factory
 +  import ExUnit.CaptureLog
  
+   clear_config([:instance, :federating])
+   clear_config([:instance, :allow_relay])
    describe "posting statuses" do
      setup do
        user = insert(:user)
index 6a6135d026a5926d3350e816c545fbf57d7e6843,c809f510ff999881f7f6703346698a470f54e1ee..c9f67c28071d58769d181ec25166e54ad9f4bdcf
@@@ -319,9 -318,9 +318,9 @@@ defmodule Pleroma.Web.PleromaAPI.Accoun
        conn: conn,
        current_user: current_user
      } do
-       user = insert(:user, %{info: %{hide_favorites: true}})
+       user = insert(:user, hide_favorites: true)
        activity = insert(:note_activity)
 -      CommonAPI.favorite(activity.id, user)
 +      CommonAPI.favorite(user, activity.id)
  
        conn =
          conn
Simple merge
Simple merge