Mastodon API: Mark the conversation as read for the author when they send a new direct message
This commit is contained in:
parent
1bfdf57fc7
commit
359dd1890e
7 changed files with 91 additions and 13 deletions
|
|
@ -48,6 +48,12 @@ defmodule Pleroma.Conversation.Participation do
|
|||
|> validate_required([:read])
|
||||
end
|
||||
|
||||
def mark_as_read(%User{} = user, %Conversation{} = conversation) do
|
||||
with %__MODULE__{} = participation <- for_user_and_conversation(user, conversation) do
|
||||
mark_as_read(participation)
|
||||
end
|
||||
end
|
||||
|
||||
def mark_as_read(participation) do
|
||||
participation
|
||||
|> read_cng(%{read: true})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue