Still trying...
This commit is contained in:
parent
7552f4e627
commit
cc826ff400
|
@ -7,14 +7,18 @@ def maketree(descendants):
|
|||
for descendant in descendants:
|
||||
if not descendant.in_reply_to_id:
|
||||
roots.add(descendant.id)
|
||||
print("ROOT", descendant.id, descendant.account.acct)
|
||||
print("ROOT", descendant.id, descendant.account.id, descendant.account.acct)
|
||||
elif descendant.in_reply_to_id in replies:
|
||||
reps = replies[descendant.in_reply_to_id]
|
||||
reps.add(descendant.id)
|
||||
print("REPLY", descendant.id, descendant.in_reply_to_id)
|
||||
print("REPLY", descendant.id,
|
||||
descendant.in_reply_to_id,
|
||||
descendant.in_reply_to_id in lookup)
|
||||
else:
|
||||
reps = set()
|
||||
print("NEWREPLY", descendant.id, descendant.in_reply_to_id)
|
||||
print("NEWREPLY", descendant.id,
|
||||
descendant.in_reply_to_id,
|
||||
descendant.in_reply_to_id in lookup)
|
||||
replies[descendant.in_reply_to_id] = set([descendant.id])
|
||||
seen = set()
|
||||
def onelevel(reps):
|
||||
|
|
|
@ -688,10 +688,10 @@ def thread(request, id):
|
|||
notifications = _notes_count(account, mastodon)
|
||||
filters = get_filters(mastodon, context="thread")
|
||||
|
||||
# Apply filters
|
||||
descendants = [
|
||||
x for x in context.descendants if not toot_matches_filters(x, filters)
|
||||
]
|
||||
# # Apply filters
|
||||
# descendants = [
|
||||
# x for x in context.descendants if not toot_matches_filters(x, filters)
|
||||
# ]
|
||||
posts = tuple(threadtree.build(descendants))
|
||||
from pprint import pprint
|
||||
pprint(posts)
|
||||
|
|
Loading…
Reference in New Issue