Remove inReplyToStatusId
This commit is contained in:
parent
8c6d5a6b4d
commit
5d73dca064
10 changed files with 56 additions and 42 deletions
|
|
@ -91,12 +91,11 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
|
|||
end
|
||||
|
||||
def increase_replies_count_if_reply(%{
|
||||
"object" =>
|
||||
%{"inReplyTo" => reply_ap_id, "inReplyToStatusId" => reply_status_id} = object,
|
||||
"object" => %{"inReplyTo" => reply_ap_id} = object,
|
||||
"type" => "Create"
|
||||
}) do
|
||||
if is_public?(object) do
|
||||
Activity.increase_replies_count(reply_status_id)
|
||||
Activity.increase_replies_count(reply_ap_id)
|
||||
Object.increase_replies_count(reply_ap_id)
|
||||
end
|
||||
end
|
||||
|
|
@ -104,10 +103,10 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
|
|||
def increase_replies_count_if_reply(_create_data), do: :noop
|
||||
|
||||
def decrease_replies_count_if_reply(%Object{
|
||||
data: %{"inReplyTo" => reply_ap_id, "inReplyToStatusId" => reply_status_id} = object
|
||||
data: %{"inReplyTo" => reply_ap_id} = object
|
||||
}) do
|
||||
if is_public?(object) do
|
||||
Activity.decrease_replies_count(reply_status_id)
|
||||
Activity.decrease_replies_count(reply_ap_id)
|
||||
Object.decrease_replies_count(reply_ap_id)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -225,12 +225,11 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
|
|||
|
||||
case fetch_obj_helper(in_reply_to_id) do
|
||||
{:ok, replied_object} ->
|
||||
with %Activity{} = activity <-
|
||||
with %Activity{} = _activity <-
|
||||
Activity.get_create_by_object_ap_id(replied_object.data["id"]) do
|
||||
object
|
||||
|> Map.put("inReplyTo", replied_object.data["id"])
|
||||
|> Map.put("inReplyToAtomUri", object["inReplyToAtomUri"] || in_reply_to_id)
|
||||
|> Map.put("inReplyToStatusId", activity.id)
|
||||
|> Map.put("conversation", replied_object.data["context"] || object["conversation"])
|
||||
|> Map.put("context", replied_object.data["context"] || object["conversation"])
|
||||
else
|
||||
|
|
|
|||
|
|
@ -228,7 +228,6 @@ defmodule Pleroma.Web.CommonAPI.Utils do
|
|||
if inReplyTo do
|
||||
object
|
||||
|> Map.put("inReplyTo", inReplyTo.data["object"]["id"])
|
||||
|> Map.put("inReplyToStatusId", inReplyTo.id)
|
||||
else
|
||||
object
|
||||
end
|
||||
|
|
|
|||
|
|
@ -291,7 +291,7 @@ defmodule Pleroma.Web.TwitterAPI.ActivityView do
|
|||
"is_local" => activity.local,
|
||||
"is_post_verb" => true,
|
||||
"created_at" => created_at,
|
||||
"in_reply_to_status_id" => object["inReplyToStatusId"],
|
||||
"in_reply_to_status_id" => reply_parent && reply_parent.id,
|
||||
"in_reply_to_screen_name" => reply_user && reply_user.nickname,
|
||||
"in_reply_to_profileurl" => User.profile_url(reply_user),
|
||||
"in_reply_to_ostatus_uri" => reply_user && reply_user.ap_id,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue