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 84aba9572a7fb9bf49971eee41ca54ddcf9bde1b..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])
@@
-343,9
+356,4
@@
defmodule Pleroma.Activity do
actor = user_actor(activity)
activity.id in actor.pinned_activities
end
actor = user_actor(activity)
activity.id in actor.pinned_activities
end
-
- @spec pinned_by_actor?(Activity.t(), User.t()) :: boolean()
- def pinned_by_actor?(%Activity{id: id}, %User{} = user) do
- id in user.pinned_activities
- end
end
end