ChatController: Add mark_as_read

This commit is contained in:
lain 2020-05-04 13:10:36 +02:00
commit b04328c3de
5 changed files with 62 additions and 1 deletions

View file

@ -60,4 +60,10 @@ defmodule Pleroma.Chat do
conflict_target: [:user_id, :recipient]
)
end
def mark_as_read(chat) do
chat
|> change(%{unread: 0})
|> Repo.update()
end
end