diff --git a/brutaldon/threadtree.py b/brutaldon/threadtree.py index 32aee85..3c1fdd8 100644 --- a/brutaldon/threadtree.py +++ b/brutaldon/threadtree.py @@ -50,5 +50,5 @@ def unmaketree(tree): yield from unmaketree(children) yield OUT -def threadtree(descendants): +def build(descendants): return unmaketree(maketree(descendants)) diff --git a/brutaldon/views.py b/brutaldon/views.py index e4d7ee0..114fde9 100644 --- a/brutaldon/views.py +++ b/brutaldon/views.py @@ -671,6 +671,7 @@ def note(request, next=None, prev=None): }, ) +import threadtree @br_login_required def thread(request, id): @@ -687,10 +688,6 @@ def thread(request, id): notifications = _notes_count(account, mastodon) filters = get_filters(mastodon, context="thread") - import pprint - pprint.pprint(context) - raise SystemExit(23) - # Apply filters descendants = [ x for x in context.descendants if not toot_matches_filters(x, filters) @@ -703,10 +700,12 @@ def thread(request, id): "context": context, "toot": toot, "root": root, - "descendants": unmaketree(maketree(descendants)), + "posts": threadtree.build(descendants)), "own_acct": request.session["active_user"], "notifications": notifications, "preferences": account.preferences, + "IN": threadtree.IN, + "OUT": threadtree.OUT, }, )