mirror of https://gitlab.com/bashrc2/epicyon
Always download the actor when checking validity, because the actor's fields may have changed
parent
b932423a25
commit
b676a15f77
27
person.py
27
person.py
|
@ -1687,17 +1687,13 @@ def valid_sending_actor(session, base_dir: str,
|
||||||
if sending_actor.endswith(domain + '/users/' + nickname):
|
if sending_actor.endswith(domain + '/users/' + nickname):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
# get their actor
|
# download the actor
|
||||||
actor_json = \
|
# NOTE: the actor should not be obtained from the local cache,
|
||||||
get_person_from_cache(base_dir, sending_actor, person_cache, True)
|
# because they may have changed fields which are being tested here,
|
||||||
downloaded_actor = False
|
# such as the bio length
|
||||||
if not actor_json:
|
actor_json, _ = get_actor_json(domain, sending_actor,
|
||||||
# download the actor
|
True, False, debug, True,
|
||||||
actor_json, _ = get_actor_json(domain, sending_actor,
|
signing_priv_key_pem, session)
|
||||||
True, False, debug, True,
|
|
||||||
signing_priv_key_pem, session)
|
|
||||||
if actor_json:
|
|
||||||
downloaded_actor = True
|
|
||||||
if not actor_json:
|
if not actor_json:
|
||||||
# if the actor couldn't be obtained then proceed anyway
|
# if the actor couldn't be obtained then proceed anyway
|
||||||
return True
|
return True
|
||||||
|
@ -1776,9 +1772,8 @@ def valid_sending_actor(session, base_dir: str,
|
||||||
sending_actor)
|
sending_actor)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if downloaded_actor:
|
# if the actor is valid and was downloaded then
|
||||||
# if the actor is valid and was downloaded then
|
# store it in the cache, but don't write it to file
|
||||||
# store it in the cache, but don't write it to file
|
store_person_in_cache(base_dir, sending_actor, actor_json,
|
||||||
store_person_in_cache(base_dir, sending_actor, actor_json,
|
person_cache, False)
|
||||||
person_cache, False)
|
|
||||||
return True
|
return True
|
||||||
|
|
Loading…
Reference in New Issue