Merge branch 'develop' into 'feature/relay'
authorkaniini <nenolod@gmail.com>
Sun, 26 Aug 2018 21:06:15 +0000 (21:06 +0000)
committerkaniini <nenolod@gmail.com>
Sun, 26 Aug 2018 21:06:15 +0000 (21:06 +0000)
# Conflicts:
#   lib/pleroma/web/activity_pub/utils.ex

1  2 
config/config.exs
lib/pleroma/user.ex
lib/pleroma/web/activity_pub/activity_pub.ex
lib/pleroma/web/activity_pub/utils.ex
lib/pleroma/web/activity_pub/views/user_view.ex
lib/pleroma/web/router.ex

Simple merge
Simple merge
index a2e5c50025c4656d6bda878184b4d440e731d4f2,7cdc1656bd34013ac64e062709d77032b687eadd..0664b5a2ed4b6f9f48b7520027ab97a451c7dd42
@@@ -374,21 -360,20 +378,27 @@@ defmodule Pleroma.Web.ActivityPub.Util
      if activity_id, do: Map.put(data, "id", activity_id), else: data
    end
  
 -  def add_announce_to_object(%Activity{data: %{"actor" => actor}}, object) do
 +  def add_announce_to_object(
 +        %Activity{
 +          data: %{"actor" => actor, "cc" => ["https://www.w3.org/ns/activitystreams#Public"]}
 +        },
 +        object
 +      ) do
-     with announcements <- [actor | object.data["announcements"] || []] |> Enum.uniq() do
+     announcements =
+       if is_list(object.data["announcements"]), do: object.data["announcements"], else: []
+     with announcements <- [actor | announcements] |> Enum.uniq() do
        update_element_in_object("announcement", announcements, object)
      end
    end
  
 +  def add_announce_to_object(_, object), do: {:ok, object}
 +
    def remove_announce_from_object(%Activity{data: %{"actor" => actor}}, object) do
-     with announcements <- (object.data["announcements"] || []) |> List.delete(actor) do
+     announcements =
+       if is_list(object.data["announcements"]), do: object.data["announcements"], else: []
+     with announcements <- announcements |> List.delete(actor) do
        update_element_in_object("announcement", announcements, object)
      end
    end
Simple merge