Merge branch 'cleanup/object-conversation' into 'develop'

Stop filling conversation field on incoming objects (legacy, unused)

See merge request pleroma/pleroma!2663
This commit is contained in:
lain 2020-06-20 09:45:01 +00:00
commit 6f6ccfccca
3 changed files with 3 additions and 7 deletions

View File

@ -41,7 +41,6 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.NoteValidator do
field(:announcements, {:array, :string}, default: [])
# see if needed
field(:conversation, :string)
field(:context_id, :string)
end

View File

@ -172,8 +172,8 @@ def fix_in_reply_to(%{"inReplyTo" => in_reply_to} = object, options)
object
|> Map.put("inReplyTo", replied_object.data["id"])
|> Map.put("inReplyToAtomUri", object["inReplyToAtomUri"] || in_reply_to_id)
|> Map.put("conversation", replied_object.data["context"] || object["conversation"])
|> Map.put("context", replied_object.data["context"] || object["conversation"])
|> Map.drop(["conversation"])
else
e ->
Logger.error("Couldn't fetch #{inspect(in_reply_to_id)}, error: #{inspect(e)}")
@ -207,7 +207,7 @@ def fix_context(object) do
object
|> Map.put("context", context)
|> Map.put("conversation", context)
|> Map.drop(["conversation"])
end
def fix_attachments(%{"attachment" => attachment} = object) when is_list(attachment) do
@ -458,7 +458,7 @@ def handle_incoming(
to: data["to"],
object: object,
actor: user,
context: object["conversation"],
context: object["context"],
local: false,
published: data["published"],
additional:

View File

@ -1571,9 +1571,6 @@ test "returns modified object when allowed incoming reply", %{data: data} do
assert modified_object["inReplyToAtomUri"] == "https://shitposter.club/notice/2827873"
assert modified_object["conversation"] ==
"tag:shitposter.club,2017-05-05:objectType=thread:nonce=3c16e9c2681f6d26"
assert modified_object["context"] ==
"tag:shitposter.club,2017-05-05:objectType=thread:nonce=3c16e9c2681f6d26"
end