diff options
author | duponin <pwet@dupon.in> | 2022-05-21 05:10:48 +0200 |
---|---|---|
committer | duponin <pwet@dupon.in> | 2022-05-21 05:10:48 +0200 |
commit | e3e8ff06f9c588563003ba9855f2d38b9d6e08b7 (patch) | |
tree | 5a84ad5e4a132e23e74090a6027a64c4d49ce00e | |
parent | c04c7f9e45eec680afc0bf6c145fa55fc3f56ea8 (diff) | |
download | pleroma-e3e8ff06f9c588563003ba9855f2d38b9d6e08b7.tar.gz pleroma-e3e8ff06f9c588563003ba9855f2d38b9d6e08b7.zip |
BBS: mark notification as read
-rw-r--r-- | lib/pleroma/bbs/handler.ex | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/pleroma/bbs/handler.ex b/lib/pleroma/bbs/handler.ex index e0174efe1..7314453af 100644 --- a/lib/pleroma/bbs/handler.ex +++ b/lib/pleroma/bbs/handler.ex @@ -94,6 +94,7 @@ defmodule Pleroma.BBS.Handler do 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("n - Show notifications") + IO.puts("n read - Mark all notifactions as read") IO.puts("quit - Quit") state @@ -141,6 +142,13 @@ defmodule Pleroma.BBS.Handler do state 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 user |> Pleroma.Web.MastodonAPI.MastodonAPI.get_notifications(%{}) |