Start support for processing transient object
This commit is contained in:
parent
8dc0e1877b
commit
4f16e3b940
3 changed files with 35 additions and 3 deletions
18
app/boxes.py
18
app/boxes.py
|
@ -836,6 +836,20 @@ async def _process_note_object(
|
|||
db_session.add(notif)
|
||||
|
||||
|
||||
async def _process_transient_object(
|
||||
db_session: AsyncSession,
|
||||
raw_object: ap.RawObject,
|
||||
from_actor: models.Actor,
|
||||
) -> None:
|
||||
ap_type = raw_object["type"]
|
||||
if ap_type in ["Add", "Remove"]:
|
||||
logger.info(f"Dropping unsupported {ap_type} object")
|
||||
else:
|
||||
logger.warning(f"Received unknown {ap_type} object")
|
||||
|
||||
return None
|
||||
|
||||
|
||||
async def save_to_inbox(
|
||||
db_session: AsyncSession,
|
||||
raw_object: ap.RawObject,
|
||||
|
@ -847,6 +861,10 @@ async def save_to_inbox(
|
|||
logger.exception("Failed to fetch actor")
|
||||
return
|
||||
|
||||
if "id" not in raw_object:
|
||||
await _process_transient_object(db_session, raw_object, actor)
|
||||
return None
|
||||
|
||||
raw_object_id = ap.get_id(raw_object)
|
||||
|
||||
# Ensure forwarded activities have a valid LD sig
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue