Merge branch 'develop' into 'reactions'
# Conflicts: # CHANGELOG.md
This commit is contained in:
commit
d7f9679ff2
136 changed files with 864 additions and 320 deletions
22
lib/mix/tasks/pleroma/count_statuses.ex
Normal file
22
lib/mix/tasks/pleroma/count_statuses.ex
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
defmodule Mix.Tasks.Pleroma.CountStatuses do
|
||||
@shortdoc "Re-counts statuses for all users"
|
||||
|
||||
use Mix.Task
|
||||
alias Pleroma.User
|
||||
import Ecto.Query
|
||||
|
||||
def run([]) do
|
||||
Mix.Pleroma.start_pleroma()
|
||||
|
||||
stream =
|
||||
User
|
||||
|> where(local: true)
|
||||
|> Pleroma.Repo.stream()
|
||||
|
||||
Pleroma.Repo.transaction(fn ->
|
||||
Enum.each(stream, &User.update_note_count/1)
|
||||
end)
|
||||
|
||||
Mix.Pleroma.shell_info("Done")
|
||||
end
|
||||
end
|
||||
|
|
@ -806,8 +806,8 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
|
|||
|
||||
defp restrict_replies(query, %{"exclude_replies" => val}) when val == "true" or val == "1" do
|
||||
from(
|
||||
activity in query,
|
||||
where: fragment("?->'object'->>'inReplyTo' is null", activity.data)
|
||||
[_activity, object] in query,
|
||||
where: fragment("?->>'inReplyTo' is null", object.data)
|
||||
)
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -167,7 +167,11 @@ defmodule Pleroma.Web.MastodonAPI.StatusController do
|
|||
def show(%{assigns: %{user: user}} = conn, %{"id" => id}) do
|
||||
with %Activity{} = activity <- Activity.get_by_id_with_object(id),
|
||||
true <- Visibility.visible_for_user?(activity, user) do
|
||||
try_render(conn, "show.json", activity: activity, for: user)
|
||||
try_render(conn, "show.json",
|
||||
activity: activity,
|
||||
for: user,
|
||||
with_direct_conversation_id: true
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue