projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Changelog: Add info about search fixes.
[akkoma]
/
lib
/
pleroma
/
activity.ex
diff --git
a/lib/pleroma/activity.ex
b/lib/pleroma/activity.ex
index 03cd3b8c0cd00d6db3ebf384c802b42d8585e5d1..553834da0b786f905f1544fc9feb395c66bc0285 100644
(file)
--- a/
lib/pleroma/activity.ex
+++ b/
lib/pleroma/activity.ex
@@
-14,6
+14,7
@@
defmodule Pleroma.Activity do
alias Pleroma.ReportNote
alias Pleroma.ThreadMute
alias Pleroma.User
alias Pleroma.ReportNote
alias Pleroma.ThreadMute
alias Pleroma.User
+ alias Pleroma.Web.ActivityPub.ActivityPub
import Ecto.Changeset
import Ecto.Query
import Ecto.Changeset
import Ecto.Query
@@
-153,6
+154,18
@@
defmodule Pleroma.Activity do
def get_bookmark(_, _), do: nil
def get_bookmark(_, _), do: nil
+ def get_report(activity_id) do
+ opts = %{
+ type: "Flag",
+ skip_preload: true,
+ preload_report_notes: true
+ }
+
+ ActivityPub.fetch_activities_query([], opts)
+ |> where(id: ^activity_id)
+ |> Repo.one()
+ end
+
def change(struct, params \\ %{}) do
struct
|> cast(params, [:data, :recipients])
def change(struct, params \\ %{}) do
struct
|> cast(params, [:data, :recipients])
@@
-301,14
+314,14
@@
defmodule Pleroma.Activity do
|> Repo.all()
end
|> Repo.all()
end
- def follow_requests_for_actor(%
Pleroma.
User{ap_id: ap_id}) do
+ def follow_requests_for_actor(%User{ap_id: ap_id}) do
ap_id
|> Queries.by_object_id()
|> Queries.by_type("Follow")
|> where([a], fragment("? ->> 'state' = 'pending'", a.data))
end
ap_id
|> Queries.by_object_id()
|> Queries.by_type("Follow")
|> where([a], fragment("? ->> 'state' = 'pending'", a.data))
end
- def following_requests_for_actor(%
Pleroma.
User{ap_id: ap_id}) do
+ def following_requests_for_actor(%User{ap_id: ap_id}) do
Queries.by_type("Follow")
|> where([a], fragment("?->>'state' = 'pending'", a.data))
|> where([a], a.actor == ^ap_id)
Queries.by_type("Follow")
|> where([a], fragment("?->>'state' = 'pending'", a.data))
|> where([a], a.actor == ^ap_id)