projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'fix/732-password-align' into 'develop'
[akkoma]
/
lib
/
pleroma
/
web
/
activity_pub
/
utils.ex
diff --git
a/lib/pleroma/web/activity_pub/utils.ex
b/lib/pleroma/web/activity_pub/utils.ex
index 81e17b9c1563474b4906c348a9e064cdb99cd193..0b53f71c3acc25471a9c531a0e9edfdb138e9475 100644
(file)
--- a/
lib/pleroma/web/activity_pub/utils.ex
+++ b/
lib/pleroma/web/activity_pub/utils.ex
@@
-99,7
+99,10
@@
defmodule Pleroma.Web.ActivityPub.Utils do
%{
"@context" => [
"https://www.w3.org/ns/activitystreams",
%{
"@context" => [
"https://www.w3.org/ns/activitystreams",
- "#{Web.base_url()}/schemas/litepub-0.1.jsonld"
+ "#{Web.base_url()}/schemas/litepub-0.1.jsonld",
+ %{
+ "@language" => "und"
+ }
]
}
end
]
}
end
@@
-423,13
+426,15
@@
defmodule Pleroma.Web.ActivityPub.Utils do
activity.data
),
where: activity.actor == ^follower_id,
activity.data
),
where: activity.actor == ^follower_id,
+ # this is to use the index
where:
fragment(
where:
fragment(
- "? @> ?",
+ "coalesce((?)->'object'->>'id', (?)->>'object') = ?",
+ activity.data,
activity.data,
activity.data,
- ^
%{object: followed_id}
+ ^
followed_id
),
),
- order_by: [
desc: :id
],
+ order_by: [
fragment("? desc nulls last", activity.id)
],
limit: 1
)
limit: 1
)
@@
-586,13
+591,15
@@
defmodule Pleroma.Web.ActivityPub.Utils do
activity.data
),
where: activity.actor == ^blocker_id,
activity.data
),
where: activity.actor == ^blocker_id,
+ # this is to use the index
where:
fragment(
where:
fragment(
- "? @> ?",
+ "coalesce((?)->'object'->>'id', (?)->>'object') = ?",
+ activity.data,
activity.data,
activity.data,
- ^
%{object: blocked_id}
+ ^
blocked_id
),
),
- order_by: [
desc: :id
],
+ order_by: [
fragment("? desc nulls last", activity.id)
],
limit: 1
)
limit: 1
)