diff --git a/toot/api.py b/toot/api.py
index 0a528cb..f268de2 100644
--- a/toot/api.py
+++ b/toot/api.py
@@ -268,8 +268,9 @@ def single_status(app, user, status_id):
return http.get(app, user, url).json()
-def get_notifications(app, user):
- return http.get(app, user, '/api/v1/notifications').json()
+def get_notifications(app, user, exclude_types=[], limit=20):
+ params={"exclude_types[]": exclude_types, "limit": limit}
+ return http.get(app, user, '/api/v1/notifications', params).json()
def clear_notifications(app, user):
diff --git a/toot/commands.py b/toot/commands.py
index 1daee12..e4f2020 100644
--- a/toot/commands.py
+++ b/toot/commands.py
@@ -316,7 +316,12 @@ def notifications(app, user, args):
print_out("Cleared notifications")
return
- notifications = api.get_notifications(app, user)
+ exclude = []
+ if args.mentions:
+ # Filter everything except mentions
+ # https://docs.joinmastodon.org/methods/notifications/
+ exclude = ["follow", "favourite", "reblog", "poll", "follow_request"]
+ notifications = api.get_notifications(app, user, exclude_types=exclude)
if not notifications:
print_out("No notification")
return
diff --git a/toot/console.py b/toot/console.py
index 9cf6b06..3e95baa 100644
--- a/toot/console.py
+++ b/toot/console.py
@@ -229,6 +229,11 @@ READ_COMMANDS = [
"default": False,
"help": "Reverse the order of the shown notifications (newest on top)",
}),
+ (["-m", "--mentions"], {
+ "action": "store_true",
+ "default": False,
+ "help": "Only print mentions",
+ })
],
require_auth=True,
),