BBS: mark notification as read

This commit is contained in:
duponin 2022-05-21 05:10:48 +02:00
parent c04c7f9e45
commit e3e8ff06f9
1 changed files with 8 additions and 0 deletions

View File

@ -94,6 +94,7 @@ def handle_command(state, "help") do
IO.puts("r <id> <text> - Reply to the post with the given id") IO.puts("r <id> <text> - Reply to the post with the given id")
IO.puts("t <id> - Show a thread from the given id") IO.puts("t <id> - Show a thread from the given id")
IO.puts("n - Show notifications") IO.puts("n - Show notifications")
IO.puts("n read - Mark all notifactions as read")
IO.puts("quit - Quit") IO.puts("quit - Quit")
state state
@ -141,6 +142,13 @@ def handle_command(%{user: user} = state, "t " <> activity_id) do
state state
end end
def handle_command(%{user: user} = state, "n read") do
Pleroma.Notification.clear(user)
IO.puts("All notifications are marked as read")
state
end
def handle_command(%{user: user} = state, "n") do def handle_command(%{user: user} = state, "n") do
user user
|> Pleroma.Web.MastodonAPI.MastodonAPI.get_notifications(%{}) |> Pleroma.Web.MastodonAPI.MastodonAPI.get_notifications(%{})