Fix timeline generator to respect --instance option

Access the anon public & tag timelines in this case. This makes it
possible to see those timelines without being logged in.
pull/176/head
Ivan Habunek 2020-06-15 20:51:44 +02:00
rodzic d5f987e1b2
commit ad272f521b
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: CDBD63C43A30BB95
3 zmienionych plików z 10 dodań i 2 usunięć

Wyświetl plik

@ -8,6 +8,7 @@ Changelog
* Fix access to public and tag timelines when on private mastodon instances
(#168)
* Add `--reverse` option to `toot notifications` (#151)
* Fix `toot timeline` to respect `--instance` option
* TUI: Add opton to pin/save tag timelines (#163, thanks @dlax)
* TUI: Fixed crash on empty timeline (#138, thanks ecs)

Wyświetl plik

@ -3,6 +3,7 @@
changes:
- "Fix access to public and tag timelines when on private mastodon instances (#168)"
- "Add `--reverse` option to `toot notifications` (#151)"
- "Fix `toot timeline` to respect `--instance` option"
- "TUI: Add opton to pin/save tag timelines (#163, thanks @dlax)"
- "TUI: Fixed crash on empty timeline (#138, thanks ecs)"

Wyświetl plik

@ -22,9 +22,15 @@ def get_timeline_generator(app, user, args):
raise ConsoleError("The --instance option is only valid alongside --public or --tag.")
if args.public:
return api.public_timeline_generator(app, user, local=args.local, limit=args.count)
if args.instance:
return api.anon_public_timeline_generator(args.instance, local=args.local, limit=args.count)
else:
return api.public_timeline_generator(app, user, local=args.local, limit=args.count)
elif args.tag:
return api.tag_timeline_generator(app, user, args.tag, local=args.local, limit=args.count)
if args.instance:
return api.anon_tag_timeline_generator(args.instance, args.tag, limit=args.count)
else:
return api.tag_timeline_generator(app, user, args.tag, local=args.local, limit=args.count)
elif args.list:
return api.timeline_list_generator(app, user, args.list, limit=args.count)
else: