don't expire pinned posts
This commit is contained in:
parent
9bf1065a06
commit
de4c935071
3 changed files with 45 additions and 3 deletions
|
|
@ -301,14 +301,14 @@ defmodule Pleroma.Activity do
|
|||
|> 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
|
||||
|
||||
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)
|
||||
|
|
@ -343,4 +343,9 @@ defmodule Pleroma.Activity do
|
|||
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue