Conversations: Add a function to 'import' old DMs.
This commit is contained in:
parent
289b8224ac
commit
fcf2f38d20
3 changed files with 38 additions and 0 deletions
|
|
@ -72,4 +72,18 @@ defmodule Pleroma.Conversation do
|
|||
e -> {:error, e}
|
||||
end
|
||||
end
|
||||
|
||||
@doc """
|
||||
This is only meant to be run by a mix task. It creates conversations/participations for all direct messages in the database.
|
||||
"""
|
||||
def bump_for_all_activities() do
|
||||
stream =
|
||||
Pleroma.Web.ActivityPub.ActivityPub.fetch_direct_messages_query()
|
||||
|> Repo.stream()
|
||||
|
||||
Repo.transaction(fn ->
|
||||
stream
|
||||
|> Enum.each(&create_or_bump_for/1)
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue