transmogrifier: accept Article activities
authorWilliam Pitcock <nenolod@dereferenced.org>
Sun, 24 Jun 2018 05:33:22 +0000 (05:33 +0000)
committerWilliam Pitcock <nenolod@dereferenced.org>
Wed, 27 Jun 2018 13:37:26 +0000 (13:37 +0000)
lib/pleroma/web/activity_pub/transmogrifier.ex

index 30cd70fb656096df97ee86fe285d8fbe3a174dc3..1b60170d9aa4294b40d3451bb139dbc5b1bce98f 100644 (file)
@@ -122,7 +122,7 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
   # TODO: validate those with a Ecto scheme
   # - tags
   # - emoji
-  def handle_incoming(%{"type" => "Create", "object" => %{"type" => "Note"} = object} = data) do
+  def handle_incoming(%{"type" => "Create", "object" => %{"type" => objtype} = object} = data) when objtype in ["Article", "Note"] do
     with nil <- Activity.get_create_activity_by_object_ap_id(object["id"]),
          %User{} = user <- User.get_or_fetch_by_ap_id(data["actor"]) do
       object = fix_object(data["object"])