Stop filling conversation field on incoming objects (legacy, unused)
conversation field is still set for outgoing federation for compatibility.
This commit is contained in:
parent
f928267773
commit
3d4cfc9c5f
@ -41,7 +41,6 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.NoteValidator do
|
|||||||
field(:announcements, {:array, :string}, default: [])
|
field(:announcements, {:array, :string}, default: [])
|
||||||
|
|
||||||
# see if needed
|
# see if needed
|
||||||
field(:conversation, :string)
|
|
||||||
field(:context_id, :string)
|
field(:context_id, :string)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -172,8 +172,8 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
|
|||||||
object
|
object
|
||||||
|> Map.put("inReplyTo", replied_object.data["id"])
|
|> Map.put("inReplyTo", replied_object.data["id"])
|
||||||
|> Map.put("inReplyToAtomUri", object["inReplyToAtomUri"] || in_reply_to_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.put("context", replied_object.data["context"] || object["conversation"])
|
||||||
|
|> Map.drop(["conversation"])
|
||||||
else
|
else
|
||||||
e ->
|
e ->
|
||||||
Logger.error("Couldn't fetch #{inspect(in_reply_to_id)}, error: #{inspect(e)}")
|
Logger.error("Couldn't fetch #{inspect(in_reply_to_id)}, error: #{inspect(e)}")
|
||||||
@ -207,7 +207,7 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
|
|||||||
|
|
||||||
object
|
object
|
||||||
|> Map.put("context", context)
|
|> Map.put("context", context)
|
||||||
|> Map.put("conversation", context)
|
|> Map.drop(["conversation"])
|
||||||
end
|
end
|
||||||
|
|
||||||
def fix_attachments(%{"attachment" => attachment} = object) when is_list(attachment) do
|
def fix_attachments(%{"attachment" => attachment} = object) when is_list(attachment) do
|
||||||
@ -458,7 +458,7 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
|
|||||||
to: data["to"],
|
to: data["to"],
|
||||||
object: object,
|
object: object,
|
||||||
actor: user,
|
actor: user,
|
||||||
context: object["conversation"],
|
context: object["context"],
|
||||||
local: false,
|
local: false,
|
||||||
published: data["published"],
|
published: data["published"],
|
||||||
additional:
|
additional:
|
||||||
|
@ -1571,9 +1571,6 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do
|
|||||||
|
|
||||||
assert modified_object["inReplyToAtomUri"] == "https://shitposter.club/notice/2827873"
|
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"] ==
|
assert modified_object["context"] ==
|
||||||
"tag:shitposter.club,2017-05-05:objectType=thread:nonce=3c16e9c2681f6d26"
|
"tag:shitposter.club,2017-05-05:objectType=thread:nonce=3c16e9c2681f6d26"
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user