mirror of https://gitlab.com/bashrc2/epicyon
Tidying
parent
09c2df6be1
commit
0cb9a946b2
11
utils.py
11
utils.py
|
@ -4991,8 +4991,12 @@ def get_quote_toot_url(post_json_object: str) -> str:
|
||||||
return remove_html(quote_url)
|
return remove_html(quote_url)
|
||||||
|
|
||||||
# More correct ActivityPub implementation - adding a Link tag
|
# More correct ActivityPub implementation - adding a Link tag
|
||||||
if post_json_object['object'].get('tag'):
|
if not post_json_object['object'].get('tag'):
|
||||||
if isinstance(post_json_object['object']['tag'], list):
|
return ''
|
||||||
|
|
||||||
|
if not isinstance(post_json_object['object']['tag'], list):
|
||||||
|
return ''
|
||||||
|
|
||||||
for item in post_json_object['object']['tag']:
|
for item in post_json_object['object']['tag']:
|
||||||
if not isinstance(item, dict):
|
if not isinstance(item, dict):
|
||||||
continue
|
continue
|
||||||
|
@ -5007,8 +5011,7 @@ def get_quote_toot_url(post_json_object: str) -> str:
|
||||||
elif isinstance(item['rel'], str):
|
elif isinstance(item['rel'], str):
|
||||||
if '_misskey_quote' in item['rel']:
|
if '_misskey_quote' in item['rel']:
|
||||||
mk_quote = True
|
mk_quote = True
|
||||||
if mk_quote:
|
if mk_quote and item.get('href'):
|
||||||
if item.get('href'):
|
|
||||||
if isinstance(item['href'], str):
|
if isinstance(item['href'], str):
|
||||||
if resembles_url(item['href']):
|
if resembles_url(item['href']):
|
||||||
return remove_html(item['href'])
|
return remove_html(item['href'])
|
||||||
|
|
Loading…
Reference in New Issue