You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Recent versions of Mastodon also returns toots/statuses in the search results. toot currently ignores them and shows a 'Nothing found' message instead.
Supporting that should be fairly straight-forward; the results are already visible when using --json. I prototyped this, which works for me:
diff --git a/toot/output.py b/toot/output.py
index 88f65ed..fa4ebd6 100644
--- a/toot/output.py+++ b/toot/output.py@@ -4,7 +4,7 @@ import shutil
import textwrap
import typing as t
-from toot.entities import Account, Instance, Notification, Poll, Status, List+from toot.entities import Account, Instance, Notification, Poll, Status, List, from_dict
from toot.utils import get_text, html_to_paragraphs
from toot.wcstring import wc_wrap
from wcwidth import wcswidth
@@ -156,6 +156,7 @@ def print_list_accounts(accounts):
def print_search_results(results):
accounts = results["accounts"]
hashtags = results["hashtags"]
+ statuses = results["statuses"]
if accounts:
click.echo("\nAccounts:")
@@ -165,7 +166,10 @@ def print_search_results(results):
click.echo("\nHashtags:")
click.echo(", ".join([format_tag_name(tag) for tag in hashtags]))
- if not accounts and not hashtags:+ if statuses:+ print_timeline(from_dict(Status, s) for s in statuses)++ if not accounts and not hashtags and not statuses:
click.echo("Nothing found")
I can make a proper PR, but I'm not sure whether that's the best way of implementing this.
The text was updated successfully, but these errors were encountered:
Recent versions of Mastodon also returns toots/statuses in the search results. toot currently ignores them and shows a 'Nothing found' message instead.
Supporting that should be fairly straight-forward; the results are already visible when using
--json
. I prototyped this, which works for me:I can make a proper PR, but I'm not sure whether that's the best way of implementing this.
The text was updated successfully, but these errors were encountered: