diff --git a/requirements.txt b/requirements.txt index 95f56d8..004fd7f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ click>=6.7 -Mastodon.py>=1.0.0 +Mastodon.py>=1.5.1 colored>=1.3.93 humanize>=0.5.1 emoji>=0.4.5 diff --git a/src/tootstream/toot.py b/src/tootstream/toot.py index 5f9db8b..4107c8f 100644 --- a/src/tootstream/toot.py +++ b/src/tootstream/toot.py @@ -1172,6 +1172,30 @@ def unfav(mastodon, rest): cprint(msg, fg("yellow")) +@command("", "Toots") +def bookmark(mastodon, rest): + """Bookmark a toot by ID.""" + rest = IDS.to_global(rest) + if rest is None: + return + mastodon.status_bookmark(rest) + item = mastodon.status(rest) + msg = " Bookmarked:\n" + get_content(item) + cprint(msg, fg("red")) + + +@command("", "Toots") +def unbookmark(mastodon, rest): + """Remove a bookmark from a toot by ID.""" + rest = IDS.to_global(rest) + if rest is None: + return + mastodon.status_unbookmark(rest) + item = mastodon.status(rest) + msg = " Removed bookmark: " + get_content(item) + cprint(msg, fg("yellow")) + + @command("", "Toots") def history(mastodon, rest): """Shows the history of the conversation for an ID. @@ -1834,6 +1858,14 @@ def faves(mastodon, rest): ) +@command("", "Profile") +def bookmarks(mastodon, rest): + """Displays posts you've bookmarked.""" + print_toots( + mastodon, mastodon.bookmarks(), ctx_name="bookmarks", add_completion=False + ) + + @command("[]", "Profile") def me(mastodon, rest): """Displays toots you've tooted.