mirror of https://gitlab.com/bashrc2/epicyon
Avoid circularity in conversation resolution
parent
159e03a782
commit
3dba69c19a
|
@ -306,6 +306,7 @@ def download_conversation_posts(authorized: bool, session,
|
|||
session, as_header, debug,
|
||||
http_prefix, domain, 0, [])
|
||||
|
||||
ids = []
|
||||
while get_json_valid(post_json_object):
|
||||
if not isinstance(post_json_object, dict):
|
||||
break
|
||||
|
@ -355,6 +356,13 @@ def download_conversation_posts(authorized: bool, session,
|
|||
if not post_json_object['object'].get('published'):
|
||||
break
|
||||
|
||||
# avoid any circularity in previous conversation posts
|
||||
if post_json_object.get('id'):
|
||||
if isinstance(post_json_object['id'], str):
|
||||
if post_json_object['id'] in ids:
|
||||
break
|
||||
ids.append(post_json_object['id'])
|
||||
|
||||
# render harmless any dangerous markup
|
||||
harmless_markup(post_json_object)
|
||||
|
||||
|
|
Loading…
Reference in New Issue