projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update banner from remote accounts.
[akkoma]
/
lib
/
pleroma
/
activity.ex
diff --git
a/lib/pleroma/activity.ex
b/lib/pleroma/activity.ex
index 0b7188abaea64c990a06464140b8b164c2f473ff..9a5e6fc787c5035dcb5d5e5a7a1f5af058fbdfed 100644
(file)
--- a/
lib/pleroma/activity.ex
+++ b/
lib/pleroma/activity.ex
@@
-1,11
+1,12
@@
defmodule Pleroma.Activity do
use Ecto.Schema
defmodule Pleroma.Activity do
use Ecto.Schema
- alias Pleroma.{Repo, Activity}
+ alias Pleroma.{Repo, Activity
, Notification
}
import Ecto.Query
schema "activities" do
field :data, :map
field :local, :boolean, default: true
import Ecto.Query
schema "activities" do
field :data, :map
field :local, :boolean, default: true
+ has_many :notifications, Notification
timestamps()
end
timestamps()
end
@@
-15,11
+16,17
@@
defmodule Pleroma.Activity do
where: fragment("(?)->>'id' = ?", activity.data, ^to_string(ap_id)))
end
where: fragment("(?)->>'id' = ?", activity.data, ^to_string(ap_id)))
end
+ # Wrong name, only returns create activities
def all_by_object_ap_id_q(ap_id) do
from activity in Activity,
where: fragment("(?)->'object'->>'id' = ?", activity.data, ^to_string(ap_id))
end
def all_by_object_ap_id_q(ap_id) do
from activity in Activity,
where: fragment("(?)->'object'->>'id' = ?", activity.data, ^to_string(ap_id))
end
+ def all_non_create_by_object_ap_id_q(ap_id) do
+ from activity in Activity,
+ where: fragment("(?)->>'object' = ?", activity.data, ^to_string(ap_id))
+ end
+
def all_by_object_ap_id(ap_id) do
Repo.all(all_by_object_ap_id_q(ap_id))
end
def all_by_object_ap_id(ap_id) do
Repo.all(all_by_object_ap_id_q(ap_id))
end