X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fconversation.ex;h=828e274504a2d6b394a520ece4bff61e6cc06b9b;hb=33f063204edb63344628bdfa72ff11f81ded62a9;hp=77933f0bec8eaee3163fc82a729d91def78c9aa4;hpb=6163fbf55328808d90bb1a84cf05ae986f941b31;p=akkoma
diff --git a/lib/pleroma/conversation.ex b/lib/pleroma/conversation.ex
index 77933f0be..828e27450 100644
--- a/lib/pleroma/conversation.ex
+++ b/lib/pleroma/conversation.ex
@@ -1,10 +1,11 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2020 Pleroma Authors
+# Copyright © 2017-2021 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Conversation do
alias Pleroma.Conversation.Participation
alias Pleroma.Conversation.Participation.RecipientShip
+ alias Pleroma.Object
alias Pleroma.Repo
alias Pleroma.User
use Ecto.Schema
@@ -58,11 +59,10 @@ defmodule Pleroma.Conversation do
def create_or_bump_for(activity, opts \\ []) do
with true <- Pleroma.Web.ActivityPub.Visibility.is_direct?(activity),
"Create" <- activity.data["type"],
- object <- Pleroma.Object.normalize(activity),
+ %Object{} = object <- Object.normalize(activity, fetch: false),
true <- object.data["type"] in ["Note", "Question"],
- 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)
-
+ ap_id when is_binary(ap_id) and byte_size(ap_id) > 0 <- object.data["context"],
+ {:ok, conversation} <- create_for_ap_id(ap_id) do
users = User.get_users_from_set(activity.recipients, local_only: false)
participations =