mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-18 15:14:42 +00:00
For non-create activities, grab the create activity to fav/rt
This commit is contained in:
parent
cd522d2139
commit
9bdea19d83
1 changed files with 6 additions and 1 deletions
|
@ -129,7 +129,12 @@ defmodule Pleroma.Web.TwitterAPI.Controller do
|
|||
end
|
||||
|
||||
def get_by_id_or_ap_id(id) do
|
||||
Repo.get(Activity, id) || Activity.get_create_activity_by_object_ap_id(id)
|
||||
activity = Repo.get(Activity, id) || Activity.get_create_activity_by_object_ap_id(id)
|
||||
if activity.data["type"] == "Create" do
|
||||
activity
|
||||
else
|
||||
Activity.get_create_activity_by_object_ap_id(activity.data["object"])
|
||||
end
|
||||
end
|
||||
|
||||
def favorite(%{assigns: %{user: user}} = conn, %{"id" => id}) do
|
||||
|
|
Loading…
Reference in a new issue