mirror of
https://git.sr.ht/~tsileo/microblog.pub
synced 2024-11-15 03:04:28 +00:00
Start delete support for actors
This commit is contained in:
parent
408308f97f
commit
f100750382
1 changed files with 10 additions and 0 deletions
10
app.py
10
app.py
|
@ -1637,6 +1637,16 @@ def inbox():
|
|||
)
|
||||
try:
|
||||
data = get_backend().fetch_iri(data["id"])
|
||||
except ActivityGoneError:
|
||||
# XXX Mastodon sends Delete activities that are not dereferencable, it's the actor url with #delete
|
||||
# appended, so an `ActivityGoneError` kind of ensure it's "legit"
|
||||
if data["type"] == ActivityType.DELETE.value and data["id"].startswith(data["object"]):
|
||||
logger.info(f"received a Delete for an actor {data!r}")
|
||||
if get_backend().inbox_check_duplicate(MY_PERSON, data["id"]):
|
||||
# The activity is already in the inbox
|
||||
logger.info(f"received duplicate activity {data!r}, dropping it")
|
||||
|
||||
get_backend().save(Box.INBOX, data)
|
||||
except Exception:
|
||||
logger.exception(f'failed to fetch remote id at {data["id"]}')
|
||||
return Response(
|
||||
|
|
Loading…
Reference in a new issue