Skip to content

Commit

Permalink
Fix for missing mentions
Browse files Browse the repository at this point in the history
Fixes #9
  • Loading branch information
Michael Thomas committed Mar 15, 2023
1 parent ffc80a5 commit 7165154
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions get_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,15 +363,15 @@ def get_replied_toot_server_id(server, toot, replied_toot_server_ids,parsed_urls
"""get the server and ID of the toot the given toot replied to"""
in_reply_to_id = toot["in_reply_to_id"]
in_reply_to_account_id = toot["in_reply_to_account_id"]
mentions = toot["mentions"]
mentions = [
mention
for mention in toot["mentions"]
if mention["id"] == in_reply_to_account_id
]
if len(mentions) == 0:
return None

mention = [
mention
for mention in mentions
if mention["id"] == in_reply_to_account_id
][0]
mention = mentions[0]

o_url = f"https://{server}/@{mention['acct']}/{in_reply_to_id}"
if o_url in replied_toot_server_ids:
Expand Down

0 comments on commit 7165154

Please sign in to comment.