More actor refresh improvements

This commit is contained in:
Thomas Sileo 2022-10-09 11:36:00 +02:00
parent 9a36b0edf5
commit b5b56e9ed5
3 changed files with 29 additions and 15 deletions

View file

@ -24,6 +24,7 @@ from app.actor import Actor
from app.actor import RemoteActor
from app.actor import fetch_actor
from app.actor import save_actor
from app.actor import update_actor_if_needed
from app.ap_object import RemoteObject
from app.config import BASE_URL
from app.config import BLOCKED_SERVERS
@ -1499,8 +1500,7 @@ async def _handle_update_activity(
)
# Update the actor
from_actor.ap_actor = updated_actor.ap_actor
from_actor.updated_at = now()
await update_actor_if_needed(db_session, from_actor, updated_actor)
elif (ap_type := wrapped_object["type"]) in [
"Question",
"Note",