Normalize the object only after ensuring the activity type is Create
authorrinpatch <rinpatch@sdf.org>
Sun, 12 May 2019 00:01:42 +0000 (03:01 +0300)
committerrinpatch <rinpatch@sdf.org>
Sun, 12 May 2019 00:01:42 +0000 (03:01 +0300)
lib/pleroma/conversation.ex

index 6e26c5fd4b8bf3e5dda2d1b0918ef9087cf0da58..0db1959889ab08cb568f64646b9c48c79969bf24 100644 (file)
@@ -47,8 +47,8 @@ defmodule Pleroma.Conversation do
   """
   def create_or_bump_for(activity) do
     with true <- Pleroma.Web.ActivityPub.Visibility.is_direct?(activity),
-         object <- Pleroma.Object.normalize(activity),
          "Create" <- activity.data["type"],
+         object <- Pleroma.Object.normalize(activity),
          "Note" <- object.data["type"],
          ap_id when is_binary(ap_id) and byte_size(ap_id) > 0 <- object.data["context"] do
       {:ok, conversation} = create_for_ap_id(ap_id)